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