AddComment
Adds a comment to the current inline content control. 💡 Please note that this inline content control must be in the document.
Syntax
expression.AddComment(sText, sAuthor, sUserId);
expression - A variable that represents a ApiInlineLvlSdt class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| sText | Required | string | The comment text. | |
| sAuthor | Optional | string | The author's name. | |
| sUserId | Optional | string | The user ID of the comment author. |
Returns
Example
This example adds a comment to the inline content control.
- Code
- Result
// How to comment an inline text element.
// Add comment to the text.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let inlineLvlSdt = Api.CreateInlineLvlSdt();
inlineLvlSdt.AddText("This is an inline text content control.");
paragraph.AddInlineLvlSdt(inlineLvlSdt);
inlineLvlSdt.AddComment("comment", "John Smith");