AddComment

function AddComment(sText: string = null, sAuthor: string = null): ApiComment | "null"

Description

Returns an array of ApiComment objects.

Parameters

sTextstringdefault: null

The comment text.

sAuthorstringdefault: null

The author's name (optional).

Returns

ApiComment | "null"

Try It

Api.AddComment("Comment 1", "Bob");
Api.AddComment("Comment 2" );
var arrComments = Api.GetComments();
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("Commet Text: ", arrComments[0].GetText());
oWorksheet.GetRange("B1").SetValue("Commet Author: ", arrComments[0].GetAuthorName());

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).