AddComment
向当前段落添加批注。 💡 请注意,此段落必须在文档中。
语法
expression.AddComment(sText, sAuthor, sUserId);
expression - 表示 ApiParagraph 类的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 默认值 | 描述 |
|---|---|---|---|---|
| sText | 必需 | string | 批注文本。 | |
| sAuthor | 可选 | string | 作者姓名。 | |
| sUserId | 可选 | string | 批注作者的用户 ID。 |
返回值
示例
在文档中为段落附加审阅批注。
// How do I add an author-attributed comment to a paragraph in a document?
// Annotate a paragraph with feedback that identifies the commenter by name in a document.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is just a sample paragraph.");
paragraph.AddLineBreak();
paragraph.AddText("The comment was added to this document.");
paragraph.AddComment("comment", "Jane");