Opening a specific Word doc

  • Thread starter Thread starter Chris
  • Start date Start date
The following should work for you:

Dim objWord As Object

' Open Microsoft Word using automation
Set objWord = New Word.Application

objWord.Documents.Open "c:\MyDoc.Doc"
objWord.Visible = True


Also, you will need to set a reference to the Microsoft Word <version>
Object Library.


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Chris said:
I know this has probably been asked loads but I can't find any useful
threads in a Google groups search.
What would the code be to open a specific Word document, from a command
button on a form. The document is
 
Thanks Cheryl,

Stupid quest but where is the Object Library in Access 2003, can't seem to find it.

Thanks
 
No problem ...

Open any code module by using Alt-F11. Then from the VB menu, click
Tools|References. This will open a small window which will show you a list
of all of the references you have incorporated into your Access application
(the ones with the checkmarks). Now scroll through the list of unchecked
references until you find "Microsoft Word xx.x Object Library", where xx.x
is the version of Word that you have installed on your computer. Put a
checkmark in the box to the left of that reference and you are "good to go".
 
Back
Top