NativeExcel for .Net Developer's Reference

IRange.Comment Property

Returns an IComment interface that represents the comment of the specified cell.

[Visual Basic]
PropertyReadOnlyCommentAsIComment
[C#]
ICommentComment{get;}
[C++]
__propertyIComment*get_Comment();
[JScript]
functiongetComment():IComment

Property Value

IComment interface.

Example

The following example sets the comment for A1 cell.

[C#]
   IRange cell = book.Worksheets[1].Range["A1"];
   cell.AddComment();
   cell.Comment.Text = "My comment";     
[VisualBasic]
   Dim cell As IRange = book.Worksheets(1).Range("A1") 
   cell.AddComment()
   cell.Comment.Text = "My comment"
[C++]
   IRange* cell;
   cell = book->Worksheets->Item[1]->Range->Item[S"A1"];
   cell->AddComment();
   cell->Comment->Text = S"My comment";

See Also

IRange Interface | NativeExcel Namespace | Formula Property