Get Started
Usage API
More information

Delete

Delete() → { boolean }

Deletes all the contents from the current range.

Parameters:

This method doesn't have any parameters.

Returns:

Type
boolean

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE delete text Document Builder");
var oRange = oDocument.GetRange(10, 21);
oRange.Delete();
builder.SaveFile("docx", "Delete.docx");
builder.CloseFile();

Resulting document