Unfortunately I don't know how to grab the information I'm trying to
display -- the percent of files that have been sent to the printer by
ShellExecute (like 1 of 15, 2 of 15, etc). So what I've done now is ugly
but maybe someone has an improvement to offer. I just made my progress
bar in time increments so at least my program has time to pause before the
"Quit Acrobat" procedure is triggered and the user will know something is
happening. Here's what I have so far (there must be a better way!):
Dim PauseTime, Start
user_print = MsgBox("The documents have been sent to the default
printer.", vbMsgBoxSetForeground)
If (user_print = vbOK) Then
UserForm1.Show
ProgressBar1.Value = 0
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
ProgressBar1.Value = 10
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
ProgressBar1.Value = 20
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
ProgressBar1.Value = 30
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
('this really continues on to ProgressBar is 100)
Else
End
End If