Bookmarks Question

Is there any way I can delete all bookmarks from a Writer document in one fell swoop rather than individually so I can start setting my own bookmarks? I have been sent a document with some 60 BMs and it get quite tedious deleting them individually.
Thanks in advance for all help.

1 Like

Open Insert>Bookmarks.... In the bottom list click on the first existing bookmark name. Scroll down to the last name and Shift click. Press the Delete button, you’re done.

If this answer helped you, please accept it by clicking the check mark to the left and, karma permitting, upvote it. If this is what you expected, close the question, that will help other people with the same question.

1 Like

Hello tonyvella, you could do it using a macro such as:

Sub DeleteAllBookmarks()
REM Removes all Bookmarks from the current Writer document.
REM This action can be undone by pressing CTRL-Z for each deleted Bookmark.
	Dim i As Integer, oBookmarks, sBookMarkNames()
	If HasUnoInterfaces( ThisComponent, "com.sun.star.text.XBookmarksSupplier" ) Then
		oBookmarks = ThisComponent.getBookmarks()
		sBookMarkNames = oBookmarks.getElementNames()
		For i = 0 To Ubound( sBookMarkNames )
			oBookmarks.getByName( sBookMarkNames( i ) ).dispose()
		Next
	End If
End Sub
1 Like