AddComment
Adds a comment to the specifed document element or array of Runs.
Parameters:
Name |
Type |
Description |
oElement |
Array.<ApiRun> | DocumentElement
|
The element where the comment will be added. It may be applied to any element which has the AddComment method. |
sText |
string
|
The comment text (required). |
sAutor |
string
|
The author's name (optional). |
Returns:
- Type
-
ApiComment
Example
Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
Api.AddComment(oParagraph, "ONLYOFFICE for developers", "Jane");
builder.SaveFile("docx", "AddComment.docx");
builder.CloseFile();
Resulting document