Get Started
Usage API
More information

AddComment

AddComment(Comment, Autor) → { bool }

Adds a comment to the document.

Parameters:

Name Type Description
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("This is just a sample text.");
oParagraph.AddLineBreak();
oParagraph.AddText("The comment was added to this document.");
oDocument.AddComment("This is a comment to the document.", "Jane");
builder.SaveFile("docx",  "AddComment.docx"); 
builder.CloseFile();

Resulting document