code for go back button

G

Gail

I have a hyperlink that takes users to a certain spot in my Word document. I
then want the user to be able to click on a button and Go Back to the spot
they just navigated from. I do not want to use the "Go Back" button on the
"Web" toollbar - I want to create my own button. I have created the button
but I am having trouble with the code to go back - here is what I have:

Private Sub CommandButton1_Click()
onClick = history.go(-1)
End Sub

Can someone please help!
 
J

Jay Freedman

There's no logical reason not to use the Back button from the Web toolbar.
If you want it on another toolbar, that's as simple as opening the Customize
dialog and holding down the Ctrl key while you drag the button to its new
location (the Ctrl key makes it copy rather than move the button).

If you're just interested in building the button and macro to see how, then
the code you need is

Application.GoBack

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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