Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hyperlink to a Word Document

Posted on 2006-07-11
5
Medium Priority
?
429 Views
Last Modified: 2012-06-27
I am working in Access 97:

I have a help manual in Word for my database.  I would like to add a button to a form and when it is clicked, have it go to a specific page of the Word document.   Can I use the hyperlink feature?

Thanks for your help.

S
0
Comment
Question by:Sasha42
  • 3
5 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17082365
unless u have some sort of macro in your word doc, try this
Bit of word automation Im afraid


Public Sub OpenWordDoc()

    Dim objWord As Object
   
    Set objWord = CreateObject("Word.Application")

'Open doc c:\mydoc.doc
    objWord.Documents.Open "C:\mydoc.doc"

'goto page 2
    objWord.Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=2, name:=""
    objWord.Visible = True
   
End Sub


0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17082626
I just tried that code and it went straight to page 2

0
 

Author Comment

by:Sasha42
ID: 17082855
Thanks for your help.

I get a variable not defined error at: =wdGoToPage
0
 
LVL 39

Accepted Solution

by:
stevbe earned 1000 total points
ID: 17083784
building upon the shoulders of a giant ...

if you want a specific named bookmark then ...

to stop the undefined variable you can either set a refernece to Word or define wdGoToBookmark = -1

Private Sub cmdHelpAddNewClient_Click()

Dim objWord As Object
Dim wdGoToBookmark As Long
   
    Set objWord = CreateObject("Word.Application")
    wdGoToBookmark = -1

    'Open doc c:\mydoc.doc
    objWord.Documents.Open "C:\mydoc.doc"

    'goto a named bookmark
    objWord.Selection.GoTo What:=wdGoToBookmark, Name:="Add Client"
    objWord.Visible = True

End Sub

Steve
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17085537
bah,
Sasha42, sorry for the late response. I was at work for a while but I left before u posted
And had guests today!

But I see u are using a bookmark method now

for your info

wdGoToPage is equvalent to 1
wdGoToFirst is also equivalent to 1

change them to 1 and see if it works for you
I would be interested to know
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question