AddReply

function AddReply(
  sText: String = null,
  sAuthorName: String = null,
  sUserId: String = null,
  nPos: Number = this.GetRepliesCount(),
): ApiComment

Description

Adds a reply to a comment.

Parameters

sTextStringdefault: null

The comment reply text (required).

sAuthorNameStringdefault: null

The name of the comment reply author (optional).

sUserIdStringdefault: null

The user ID of the comment reply author (optional).

nPosNumberdefault: this.GetRepliesCount()

The comment reply position.

Returns

ApiComment

Try It

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

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).