Solved

Hyperlink to a Word Document

Posted on 2006-07-11
5
423 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 250 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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 …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 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