Get Started
Usage API
More information

AddComment

AddComment(Comment, Autor) → { bool }

Add a comment to the paragraph.

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 paragraph.");
oParagraph.AddLineBreak();
oParagraph.AddText("The comment was added to this document.");
oParagraph.AddComment("comment", "Jane");
builder.SaveFile("docx", "AddComment.docx");
builder.CloseFile();

Resulting document