跳到主要内容

GetReply

返回指定的批注回复。

语法

expression.GetReply(nIndex);

expression - 表示 ApiComment 类的变量。

参数

名称必需/可选数据类型默认值描述
nIndex可选Number0批注回复索引。

返回值

ApiCommentReply

示例

从电子表格中的批注线程读取特定回复。

// How do I access a particular reply within a comment thread in a spreadsheet?

// Retrieve the text of a chosen reply to inspect its contents in a spreadsheet.

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());