NativeExcel for .Net Developer's Reference

IRange.AddCommentMethod(String)

Adds a comment to the cell and returns IComment interface.

[Visual Basic]
FunctionAddComment(_
ByValatextAsString_
)AsIComment
[C#]
ICommentAddComment(
stringatext
);
[C++]
IComment*AddComment(
String*atext
);
[JScript]
functionAddComment(
Stringatext
):IComment;

Parameters

atext
The comment text.

Example

The following example adds the comment to A1 cell.

[C#]
book.Worksheets[1].Range["A1"].AddComment("My comment");
[VisualBasic]
book.Worksheets(1).Range("A1").AddComment("My comment")
[C++]
book->Worksheets->Item[1]->Range->Item[S"A1"]->AddComment(S"My comment");

See Also

IRange Interface | NativeExcel Namespace | IRange.AddComment Overload List