Get Started
Usage API

DeleteBookmark

DeleteBookmark(sName) → { bool }

Removes a bookmark from the document, if one exists.

Parameters:

Name Type Description
sName string

bookmark name

Returns:

Type
bool

Example

Copy code
builder.CreateFile( "docx "); 
oDocument = Api.GetDocument(); 
oParagraph = oDocument.GetElement(0); 
oParagraph.AddText( "ONLYOFFICE Document Builder "); 
oRange = oDocument.GetRange(0, 9); 
oRange.AddBookmark( "Bookmark"); 
oDocument.DeleteBookmark("Bookmark");
oParagraph = Api.CreateParagraph();
oParagraph.AddText("The bookmark was removed from this document.");
oDocument.Push(oParagraph);
builder.SaveFile( "docx ",  "DeleteBookmark.docx "); 
builder.CloseFile();

Resulting document