Return from viewing bookmark

R

roccogrand

I have a short glossary of abbreviations in a document. Each item is defined
as a bookmark.

I want to place hyperlinks throughout the document that will take readers to
the item on the glossary page.

How can I create a button for each glossary item that will take the reader
back to where he/she invoked the hyperlink?

Thanks.
 
H

Helmut Weber

Hi roccogrand,

if it is just for you and not for an end-user,
i'd add two buttons:
HyperlinkOpen,
MyGoback.

In Options, you have to set
Options.CtrlClickHyperlinkToOpen = True,
or in the macro i my example,
for several reason. Can't explain all.

So you put the cursor in the hyperlink.
Execute HyperlinkOpen.
Leads you to the hyperlink.

Do something. Except deleting the bookmark
which was created by HyperlinkOpen.

Click MyGoback.

Sub HyperlinkOpen()
Options.CtrlClickHyperlinkToOpen = True
Selection.Bookmarks.Add "Goback"
Selection.Hyperlinks(1).Follow
End Sub

Sub MyGoBack()
ActiveDocument.Bookmarks("Goback").Select
ActiveDocument.Bookmarks("Goback").Delete
End Sub

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

HTH
 

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