AddComment
Adds a comment to the desired element or array of Runs.
Parameters:
Name |
Type |
Description |
oElement |
Array.<ApiRun> | ApiParagraph | ApiDocument
|
The element where a comment will be added. It may be Document, Paragraph or Run[]. |
Comment |
string
|
The comment text. |
Autor |
string
|
The author's name (not obligatory). |
Returns:
- Type
-
bool
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