Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent Word Quitting Message 1

Status
Not open for further replies.

mveera

Programmer
Nov 6, 2002
81
US
Hi,

I am opening a Rich Text document using a Word application to print. Once the document is called i open the PrintDialog and when the user selects the printer and clicks okay i close the Word Application. But when i close the word application i get the following message
"Word is currently printing. Quitting word will cancel all pending print jobs. Do you want to quit Word?"

How can i prevent this message without affecting the printing?
Also is it possible to know the status of an Application., say word is printing, so that i can wait until it finishes the printing to close the application.

Thanks
Veera
 


1. You could check the properties of your printer to ensure that data is saved to a file before printing.

2. Here is some code that works in Excel by trapping the error and calling a wait routine.
'---------------------------------------
Sub printout()
On Error GoTo wait_a_bit
Counter = 0 ' to count waits
'------------------
'- your existing code
mysheet.printout
DoEvents '- added line
'------------------
Application.StatusBar = False
Exit Sub
wait_a_bit:
counter = counter + 1
Application.StatusBar = " Waiting. Number : " &counter
'- wait for 20 seconds
Application.Wait Now + TimeValue("00:00:20")
Application.StatusBar = " Printing"
Resume
End Sub
'------------------------------------------

Regards
BrianB
** Let us know if you get something that works !
================================
 
Word has background printing option. This will set it with VBA:
[tt]Options.PrintBackground = True[/tt]

combo

 
Thank You guys for your suggestions.

Even though i set Options.PrintBackground = True, it still gave me the message when i try to quit.

But i found an Application property called BackgroundPrintingStatus. Which returns the number of print jobs in the background printing queue for the application. i do nothing until the BackgroundPrintingStatus property returns me 0. Once the property returns 0 i quit the word application.

Thanks
Veera

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top