AddComment

AddComment(sText, sAuthor) → { ApiComment | null }

Returns an array of ApiComment objects.

Parameters:

Name Type Description
sText string

The comment text.

sAuthor string

The author's name (optional).

Returns:

Type
ApiComment | null

Example

Copy code
builder.CreateFile("xlsx");
Api.AddComment("Comment 1", "John Smith");
Api.AddComment("Comment 2", "Mark Potato" );
var arrComments = Api.GetComments();
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("Comment text: " + arrComments[0].GetText());
oWorksheet.GetRange("A2").SetValue("Comment author: " + arrComments[0].GetAuthorName());
builder.SaveFile("xlsx", "AddComment.xlsx");
builder.CloseFile();

Resulting document