K
Kevin Davis
Hello,
When I try to print from the document, I get a -2147221233 The
operation failed. An object could not be found. The code is below.
Sub cmdPrint_Click()
Dim oWordApp
Dim oDoc
Dim bolPrintBackground
if bSendtoTemplate(oWordApp,oDoc) then
'Send to printer
On Error resume next
bolPrintBackground = oWordApp.Options.PrintBackground
'Turn Background printing off
oWordApp.options.PrintBackground = False
'Print Document
oDoc.PrintOut
Select Case Err.Number
Case 0
Case Else
MsgBox "Printer not found. Please make sure you have a default
printer. ", 64, gsTITLE
End Select
'oDoc.Show
'Restore Previous settings
oWordApp.options.PrintBackground = bolprintBackground
'close without saving changes
oDoc.Close 0
'Close word instance
oWordApp.quit
'Clean Up
Set odoc = nothing
Set owordapp = nothing
End if
End Sub
Thank you,
Kevin Davis
When I try to print from the document, I get a -2147221233 The
operation failed. An object could not be found. The code is below.
Sub cmdPrint_Click()
Dim oWordApp
Dim oDoc
Dim bolPrintBackground
if bSendtoTemplate(oWordApp,oDoc) then
'Send to printer
On Error resume next
bolPrintBackground = oWordApp.Options.PrintBackground
'Turn Background printing off
oWordApp.options.PrintBackground = False
'Print Document
oDoc.PrintOut
Select Case Err.Number
Case 0
Case Else
MsgBox "Printer not found. Please make sure you have a default
printer. ", 64, gsTITLE
End Select
'oDoc.Show
'Restore Previous settings
oWordApp.options.PrintBackground = bolprintBackground
'close without saving changes
oDoc.Close 0
'Close word instance
oWordApp.quit
'Clean Up
Set odoc = nothing
Set owordapp = nothing
End if
End Sub
Thank you,
Kevin Davis