how do I delete all bookmarks in a Word file?

L

Lily

I have a Word document, copied from a HTML document. It is full of bookmarks,
and I am not willing to click a hundred times to delete these. How can I
select them all and delete them all in one go?
 
M

Michael Bednarek

I have a Word document, copied from a HTML document. It is full of bookmarks,
and I am not willing to click a hundred times to delete these. How can I
select them all and delete them all in one go?

Try this:

Dim lngHowMany As Long
Dim i As Long

lngHowMany = ActiveDocument.Bookmarks.Count

For i = lngHowMany To 1 Step -1
ActiveDocument.Bookmarks(i).Delete
Next i
 
Top