TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

SetText

SetText(sText) → { ApiComment }

Sets the comment text.

Parameters:

Name Type Description
sText string

The comment text.

Returns:

Type
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();
aComments[0].SetText("new comment");
builder.SaveFile("docx", "SetText.docx");
builder.CloseFile();

Resulting document