GetAllComments

GetAllComments() → { Array.<ApiComment> }

Returns all comments from the current document.

Parameters:

This method doesn't have any parameters.

Returns:

Type
Array.<ApiComment>

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is just a sample text");
Api.AddComment(oParagraph, "comment", "John Smith");
var aComments = oDocument.GetAllComments();
var sType = aComments[0].GetClassType();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Class type: " + sType);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "GetAllComments.docx");
builder.CloseFile();

Resulting document