G
Gina
Hi all,
I try to print out a word document from within access vba so that it it
printed in the background when I set word document to visible:=False
this is the function where the error occurs:
________________________
Public Function PrintBill() As Boolean
Dim printedOK As Boolean
---> getting an automation error because of wrong syntax
Set wdApp = GetObject(Word.Application)
Set DC = GetObject(Word.ActiveDocument)
--->
wdApp.ActiveWindow.PrintOut DC, Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=2, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=False
wdApp.ActiveDocument.Close
Set DC = Nothing
Set wdApp = Nothing
PrintBill = True
End Function
__________________________
I set the word application visible so I have to go to word and press the
print button manually.
Any help most welcome as I don't have a clou as to what the syntax might be
Thanks,
Gina
I try to print out a word document from within access vba so that it it
printed in the background when I set word document to visible:=False
this is the function where the error occurs:
________________________
Public Function PrintBill() As Boolean
Dim printedOK As Boolean
---> getting an automation error because of wrong syntax
Set wdApp = GetObject(Word.Application)
Set DC = GetObject(Word.ActiveDocument)
--->
wdApp.ActiveWindow.PrintOut DC, Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=2, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=False
wdApp.ActiveDocument.Close
Set DC = Nothing
Set wdApp = Nothing
PrintBill = True
End Function
__________________________
I set the word application visible so I have to go to word and press the
print button manually.
Any help most welcome as I don't have a clou as to what the syntax might be
Thanks,
Gina