To open a word document, create reference to Microsoft Word and then
Function Open_WordDoc()
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String
DocPath = "Path and name of the document"
Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)
objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display
End Function
> Is is possible to call and print a Word document (template) from Access using
> vba?
> Thanks
snaggy^^ - 10 Feb 2007 14:41 GMT
How can I make this work in access 2007? The object Word.application doesn't
work anymore, does it?
> To open a word document, create reference to Microsoft Word and then
>
[quoted text clipped - 18 lines]
> > vba?
> > Thanks
Sasquatch - 04 Apr 2007 15:06 GMT
From the VBA code window in Access you have to go to "Tools / References..."
and add the reference to the "Microsoft Word x.0 Object Library" before you
can declare the Word.Application object.
I'm using Office XP so my reference to the 10.0 Object Library, so I assume
Office 2003 is 11.0 and Office 2007 is 12.0
> How can I make this work in access 2007? The object Word.application doesn't
> work anymore, does it?