Get Started
Usage API
More information

AddComment

AddComment(Comment, Autor) → { bool }

Add 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 "); 
oDocument = Api.GetDocument(); 
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 a comment to the document.", "Jane");
builder.SaveFile( "docx ",  "AddComment.docx "); 
builder.CloseFile();

Resulting document