Open Word Help File from Access

Richie2837

Registered User.
Local time
Today, 16:56
Joined
Jan 30, 2007
Messages
88
Hi,

Is there a way of creating a link to a Word document which I have written as a set of instructions for users of our database, and having that link appear on the main database switchboard?
 
Create a module and assign a button on your switchboard and use the following code.

Private Sub cmdFile_Click()
'
'ENSURE Tools/references Microsoft Word 9.0 Object Library is checked [or]
'
Dim WordObj As Word.Application
Dim WordDoc As Word.Document

' close any previous links - just housekeeping but seems to run better.
Set WordObj = Nothing
Set WordDoc = Nothing
'
' open an instance of microsoft word
Set WordObj = CreateObject("Word.Application")

' open the word document
Set WordDoc = WordObj.Documents.Open("c:\temp\Help.doc")

WordObj.Visible = True

MsgBox "here"
'<--------- do whatever you need to do to the document here or close as per the next 5 lines of code

WordDoc.Close wdDoNotSaveChanges
'et WordDoc = Nothing

'close microsoft word
WordObj.Application.Quit True
Set WordObj = Nothing

End Sub

(remove the code from the Msgbox if you don't need it)


OR

from a Command Button on the stwitchboard

FollowHyperlink "c:\temp\help.doc"
 

Users who are viewing this thread

Back
Top Bottom