Skip to main content

RemoveReplies

Removes the specified comment replies.

Syntax

expression.RemoveReplies(nPos, nCount, bRemoveAll);

expression - A variable that represents a ApiComment class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nPosOptionalNumber0The position of the first comment reply to remove.
nCountOptionalNumber1A number of comment replies to remove.
bRemoveAllOptionalbooleanfalseSpecifies whether to remove all comment replies or not.

Returns

ApiComment

Example

Remove the specified comment replies in a document.

// How to delete specified comment reply in a document.

// Get all comments from the presentation and remove a reply from the first one's.

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);
comments[0].RemoveReplies();
paragraph = Api.CreateParagraph();
paragraph.AddText("The comment replies were removed");
doc.Push(paragraph);