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 / December 2004

Tip: Looking for answers? Try searching our database.

User Form Prevents Printing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Montana DOJ Help Desk - 11 Dec 2004 05:49 GMT
Word 2000

I have a macro that prints a document.  The macro displays a user form to
ask the user if the document printed.  If so, certain actions are taken.  If
not, those actions are skipped.  The problem that I have run into is that
the document will not print until AFTER the user clears the dialog box.  I
have tried to solve the problem by inserting the following code into the
routine:

   PauseTime = 20    ' Set duration.
   StartTime = Timer    ' Set start time.
   Do While Timer < StartTime + PauseTime
       DoEvents    ' Yield to other processes.
   Loop

   MessageReason = "Document printed"
   DisplayMessage

DisplayMessage is a routine that just displays the message to the user.
Sometimes this works, and sometimes not.  Is there a better way to handle
this situation?  For example, is there a way to prevent the user form from
being displayed until Word has finished sending the print job?

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
Doug Robbins - 11 Dec 2004 11:20 GMT
Set background printing to false.

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Word 2000
>
[quoted text clipped - 26 lines]
>
> "Making the world a safer place."
Montana DOJ Help Desk - 15 Dec 2004 05:45 GMT
Doug,

Your suggestion fixed the problem.  Thanks!

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
> Set background printing to false.
>
[quoted text clipped - 28 lines]
> >
> > "Making the world a safer place."
 
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.