User Form Prevents Printing

  • Thread starter Montana DOJ Help Desk
  • Start date
M

Montana DOJ Help Desk

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."
 
D

Doug Robbins

Set background printing to false.

--
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
 
M

Montana DOJ Help Desk

Doug,

Your suggestion fixed the problem. Thanks!

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 

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