AddComment
Adds a comment to the current run. 💡 Please note that this run must be in the document.
Syntax
expression.AddComment(sText, sAuthor, sUserId);
expression
- A variable that represents a ApiRun 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 run.
- Code
- Result
// How to comment a specific text.
// Insert a comment into the run and add an author to it.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let run = Api.CreateRun();
run.AddText("This is just a sample text. Nothing special.");
paragraph.AddElement(run);
run.AddComment("comment", "John Smith");