waiting for another application to finish

  • Thread starter Thread starter Bre-x
  • Start date Start date
B

Bre-x

Hi,

I have a db that send some data to MS Word (invoices).

On MS Word a have a macro the print the document (PDF Printer)
then on MS Access I have a function that email the PDF file just printed by
MS Word.

Now, my problem is that MS Word has not finish printing the document and MS
Access
try to email the PDF as an attachment. No need to tell that an error occurs
because there
is not such a file.

Is there a way to find out if the file has been printed?
actually its not even MS Word fault is the dam printer that takes a while to
print the file

Regards,

Bre-x
 
You have two options here:
1. force Word to do foreground printing, like activedocument.PrintOut
background:=true
2. Check Background prining status in a loop and exit the loop when it
reaches zero,

while word_Application.BackgroundPrintingStatus
doevents
wend

I prefer the second method because it does not display "word is printing"
message,
but be aware that it must run from a different thread than Word itself
(as it probably is in your case) to be successful, otherwise it will never
return.
 
Back
Top