PDA

View Full Version : [SOLVED:] Selecting multiple bookmarks



shahar
10-26-2015, 08:13 AM
Hi experts,

I'm searching for a way to select all the bookmarks with a name starting with G, instead of writing them one by one (word 2010).


ActiveDocument.Bookmarks("g1").Range.Font.Hidden = True
.
.
.
ActiveDocument.Bookmarks("g32").Range.Font.Hidden = True
ActiveDocument.Bookmarks("g33").Range.Font.Hidden = True


Any ideas?

Thanks in advance.

Boris_R
10-26-2015, 02:02 PM
Try macro

Sub HideBkmk()
Dim bkmk As bookmark
For Each bkmk In ActiveDocument.Bookmarks
If bkmk.Name Like "g#*" Then
bkmk.Range.Font.Hidden = True
End If
Next
End Sub

shahar
10-27-2015, 01:53 AM
Works wonders !

Great, thanks Boris_R !