跳到主要内容

AddReply

向批注添加回复。

语法

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

expression - 表示 ApiComment 类的变量。

参数

名称必需/可选数据类型默认值描述
sText必需String批注回复文本(必需)。
sAuthorName必需String批注回复作者的姓名(可选)。
sUserId必需String批注回复作者的用户 ID(可选)。
nPos可选Numberthis.GetRepliesCount()批注回复位置。

返回值

此方法不返回任何数据。

示例

此示例向批注添加回复。

// How to reply to a comment.

// Add a commnet reply indicating an author and id.

let worksheet = Api.GetActiveSheet();
worksheet.GetRange("A1").SetValue("1");
let range = worksheet.GetRange("A1");
let comment = range.AddComment("This is just a number.");
comment.AddReply("Reply 1", "John Smith", "uid-1");
let reply = comment.GetReply();
worksheet.GetRange("A3").SetValue("Comment's reply text: ");
worksheet.GetRange("B3").SetValue(reply.GetText());