Waiting for a PDf to finish printing.

Tiro Cupidus

Registered User.
Local time
Today, 00:40
Joined
Apr 25, 2002
Messages
263
I'm wanting to zip up a folder after a pdf has finished printing, and is saved in the folder. I can't seem to hold off the zip operation until the pdf is finished, though. I've tried using a Sleep, DoEvents, and whatever I can think of, but that always stalls the Acrobat printer until the function is finished, after which Acrobat will continue (along with the premature zip operation).
 
Any help on this one? I think Sleep and DoEvents don't work because the pdf is an outside process. Maybe I need to do something with the Acrobat api. Something to tell when the distiller is no longer active.
 
The file is write protected or something?

Couldn't you just get VB to keep checking permissions every few seconds or whatever until you have them, the continue on?
 
I guess my main problem is the pdf process is completely halted while there is still code to execute. Even if I just have a message box popped up, the distiller is frozen.
 
Hello,

I had a similar problem. I was wanting to copy and rename a PDF as it was printed but had the problem of a file not being there to copy as it was still waiting for it to print. In the end I used the sleep function which I found on this forum and it works great, so long as I give access enough time to print the report. Try changing the sleep time to give it longer.

Mark
 
I'm curious... how are you guys calling the pdf to print? When a file prints... it is entered in the queue with all the information. So if you opened up a word document, clicked print, and then closed word... even though the file isn't opened anymore... all the data is stored in either memory, or in temp on your hd.
 
I ended up setting the reports default printer to a PDF and then opening the report on a docmd.openreport, acviewnormal command, so that by default it printed to my documents.
Thanks

Mark
 

Users who are viewing this thread

Back
Top Bottom