How to Goto the multiple location of the bookmark of the same name

S

Shrikant

I have given several bookmark names to multiple locations. For example, the
bookmark name 'Governance' is given to more than one location. I now want to
goto these locations one by one. However, the Goto command takes me only to
the single location of the bookmark named Governance. I wanted to have a key
something like we are having in the 'Find' feature with 'Next' button.
Or is it that we are supposed to give only single name single location for a
bookmark ?
 
L

Lene Fredborg

I am not sure I understand your description. Bookmarks must have unique names
and it sounds as if you have more bookmarks named "Governance" - this is not
possible. However, if you just wish to go to the next bookmark, you could use
the following macro to go to the next bookmark regardless of the bookmark
name:

Sub GoToNextBookmark()

Dim n As Long

'Find index number of selected or preceding bookmark
n = Selection.PreviousBookmarkID

With ActiveDocument
If .Bookmarks.Count > n Then
.Range.Bookmarks(n + 1).Select
Else
MsgBox "No bookmarks found after the selection.", vbOKOnly, "Go
To Next Bookmark"
End If
End With

End Sub

If you need help on installing a macro, see:
http://www.gmayor.com/installing_macro.htm

You can assign a shortcut to the macro or add it to a toolbar (or the QAT in
case of Word 2007).

--
Regards
Lene Fredborg - Microsoft MVP (Word)
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
S

Suzanne S. Barnhill

As Lene points out, bookmarks must be unique. When you applied the bookmark
"Governance" to the second text selection, you actually moved the bookmark
from the first position to the second.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 

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