How pause code but keep printer running?

B

Bob Collin

I have four print statements in my VBA code each of which requires that
different paper be loaded in the printer. This means I have to stop the code
from running until the current printing is finished. When the current
printing is finished I need to load new paper and then restart the code. How
do I use VBA to pause the code but keep the printer going until it finishes
its current job? I have tried MsgBox but this stops both the code and printer.
 
J

Jay Freedman

In each ActiveDocument.PrintOut statement, set Background:=False. That
makes VBA block (stop processing more VBA statements) until the print
job has been sent to the spooler (or to the printer, if spooling is
disabled). Then the next statement should be a MsgBox telling the
operator to change the paper and click OK when ready.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top