Solution: You must turn off the the error messaging and backgroud printing, then print the document, then you can turn everything back on the way it was. Here is the code snippet to show you how.
Dim objWordApp
As Word.Application
Dim blnWordAlerts As Boolean
'............
'code
'............
' Store current Background Printing setting.
blnWordAlerts =
objWordApp.Options.PrintBackground
'
Turn off error messaging and Background Printing.
objWordApp.Application.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
'objWordApp.wdAlertsNone()
objWordApp.Options.PrintBackground = False
'
Print the active document.
objWordApp.ActiveDocument.PrintOut(False)
'false allows the print to finish before it moves to
any other code
'
Turn on error messaging and restore Background Printing
' to
original setting.
objWordApp.Application.DisplayAlerts = Word.WdAlertLevel.wdAlertsAll
objWordApp.Options.PrintBackground = blnWordAlerts
No comments:
Post a Comment