跳到主要内容

AddReply

向批注添加回复。

语法

expression.AddReply(sText, sAuthorName, sUserId, nPos);

expression - 表示 ApiComment 类的变量。

参数

名称必需/可选数据类型默认值描述
sText必需String批注回复文本。
sAuthorName可选String批注回复作者的姓名。
sUserId可选String批注回复作者的用户 ID。
nPos可选Number-1批注回复位置。如果 nPos=-1,则添加到末尾。

返回值

ApiComment

示例

此示例添加批注并为其添加回复。

// How to reply to the comment.

// Create a comment from a paragraph and add a reply to its first one.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is just a sample text");
Api.AddComment(paragraph, "comment", "John Smith");
let comments = doc.GetAllComments();
comments[0].AddReply("reply1", "Mark Potato", "uid-2", 0);