| | |
|
|
|
Opening a specific Word doc |
| message from Chris on 5 May 2004 |
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
situated in the same directory as my database.
|
| Cheryl Fischer replied to Chris on 5 May 2004 |
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.
|
| Chris replied to Cheryl Fischer on 5 May 2004 |
Thanks Cheryl,
Stupid quest but where is the Object Library in Access 2003, can't seem to find it.
Thanks
"Cheryl Fischer" <cherylfischer@NOSPAMmsn.com> wrote in message news:urMTdFsMEHA.1644@TK2MSFTNGP09.phx.gbl...
|
| Cheryl Fischer replied to Chris on 5 May 2004 |
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".
|
|
Archived message: Opening a specific Word doc (MS Access Forms)