Skip to main content

Delete

Deletes all the contents from the current range.

Syntax

expression.Delete();

expression - A variable that represents a ApiRange class.

Parameters

This method doesn't have any parameters.

Returns

boolean

Example

This example deletes all the contents from the range.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE delete text Document Builder");
let range = doc.GetRange(10, 21);
range.Delete();