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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top