Skip to main content

AddReply

Adds a reply to a comment.

Syntax

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

expression - A variable that represents a ApiComment class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTextRequiredStringThe comment reply text (required).
sAuthorNameRequiredStringThe name of the comment reply author (optional).
sUserIdRequiredStringThe user ID of the comment reply author (optional).
nPosOptionalNumberthis.GetRepliesCount()The comment reply position.

Returns

This method doesn't return any data.

Example

Add a reply to a comment in a spreadsheet.

// The comment is added to cell A1 containing a numeric value.

// Retrieve the reply text with the specified author name and user id and display it in cell B3.

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