Hi =?Utf-8?B?TWFya04=?=,
I have many documents containing lots of bookmarks. Many of these bookmarks
are no longer required and I want to remove all bookmarks with names that
contain "_LINK". Is this something that can be done or is this going to be a
long day??
Shouldn't be a huge problem. Here's a bit of code, off the top of my head:
Sub RemoveLINKBookmarks()
Dim doc As Word.Document
Dim bkm As Word.Bookmark
Dim aBKM() As String
Dim counter As Long
Set doc = ActiveDocument
counter = 0
ReDim aBKM(doc.Bookmarks.Count)
For Each bkm In doc.Bookmarks
If InStr(bkm.Name, "_LINK") <> 0 Then
aBKM(counter) = bkm.Name
counter = counter + 1
End If
Next
For counter = LBound(aBKM()) To UBound(aBKM())
If Len(aBKM(counter)) > 0 Then
doc.Bookmarks(aBKM(counter)).Delete
End If
Next
End Sub
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail
