Print Word document from Access Form
Hi I am trying to print a Word document from within an Access 2000 application form. I am using the following code:
Private Sub Command2_Click()
Dim wrd As Word.Application
Set wrd = Word.Application
wrd.Visible = True
wrd.Documents.Open Filename:="Q:\Example.doc"
wrd.ActiveDocument.PrintOut
Do While wrd.BackgroundPrintingStatus <> 0
DoEvents 'Let Word print the document
Loop
wrd.Quit
End Sub
But when I attempt to run it I get the following error:
"ActiveX component can't create object"
Can anyone suggest what I am doing wrong Many thanks in advance
Peter
|