AddComment
Adds a comment to the current inline content control.
Please note that this inline content control must be in the document.
Parameters:
Name |
Type |
Description |
sText |
string
|
The comment text (required). |
sAutor |
string
|
The author's name (optional). |
Returns:
- Type
-
ApiComment
Example
Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oInlineLvlSdt = Api.CreateInlineLvlSdt();
oInlineLvlSdt.AddText("This is an inline text content control.");
oParagraph.AddInlineLvlSdt(oInlineLvlSdt);
oInlineLvlSdt.AddComment("comment", "John Smith");
builder.SaveFile("docx", "AddComment.docx");
builder.CloseFile();
Resulting document