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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can a macro tell when a print job is successful?

Status
Not open for further replies.

JeaShe

Programmer
Mar 9, 2004
89
US
I have a macro that performs a mailmerge in Word. It chooses to print 2 or 3 copises of the merged letters, then closes document.

My problem is I can't control the amount of time between when the macro command to print is sent and the close document command.

Since the printer gets a lot of use and since a mailmerge seems to take several seconds I need to be able to wait until the print job is done prior to moving to the next command which is to close the document without saving changes.

 
How your macro print the letters ?
If it use the Word.Application.PrintOut method then simply add False as 1st argument:
.PrintOut False 'Background:=False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The problem is that the next step is to close the word doc. The code goes to that step before the print job is sent (I guess) which seems to take longer when based on a mail merge.

How can the macro know when the print job is done so it can close the doc?
 
JeaShe
Did you got solution for this problem? I have database that print PO from access database and corresponding document(word, excel, pdf,..) from other application(s). My problem is that it's not printing in order. Access print the PO then it's print sometime only one document out of 2 from other application then it print sencond PO and after that it's print 2nd document corresponding to the first PO and then for the second PO.
How does the the access know that the print from the other application is done and go to the next po.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top