Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

How pause code but keep printer running?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Collin - 01 Oct 2006 16:19 GMT
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.
Signature

Bob Collin

Jay Freedman - 01 Oct 2006 18:25 GMT
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        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>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.
Bob Collin - 01 Oct 2006 20:20 GMT
Jay,
Many thanks. Your answer was just what I needed.
Signature

Bob Collin

> In each ActiveDocument.PrintOut statement, set Background:=False. That
> makes VBA block (stop processing more VBA statements) until the print
[quoted text clipped - 15 lines]
> >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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.