Bookmark.Delete method (Word)

Deletes the specified bookmark.

Syntax

expression.Delete

expression Required. A variable that represents a Bookmark object.

Example

If a bookmark named "temp" exists in the active document, this example deletes the bookmark.

Sub DeleteBookmark() 
 Dim intResponse As Integer 
 Dim strBookmark As String 
 
 strBookmark = "temp" 
 
 intResponse = MsgBox("Are you sure you want to delete " _ 
 & "the bookmark named """ & strBookmark & """?", vbYesNo) 
 
 If intResponse = vbYes Then 
 If ActiveDocument.Bookmarks.Exists(Name:=strBookmark) Then 
 ActiveDocument.Bookmarks(Index:=strBookmark).Delete 
 End If 
 End If 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.