code execution + print job 
Author Message
 code execution + print job

Hi all,
I use a piece of VBA code to export an access report to pdf.
Then I want to add the file as attachment to an otlook mail message.

Problem: sometimes access adds the file before the document is actually
printed..
Is there a way to make access wait until the document is printed?
can I wait for the printspooler to be emptied?

Thanks,
Harry

code looks like following:

Call ahtSetDefaultPrinter(drnew)  'sets the Acrobat Distiller 'printer' as
default
DoCmd.OpenReport strReportToPrint, acViewNormal 'prints the report to file
Call ahtSetDefaultPrinter(drold) 'resets to the original printer

Set olitem = ol.CreateItem(olMailItem)
olitem.Attachments.add "C:\Program Files\Adobe\Acrobat 4.0\PDF Output\" &
strReportToPrint & ".pdf" 'PROBLEM HERE
olitem.Display



Fri, 19 Sep 2003 17:28:37 GMT  
 code execution + print job
Harry Saenen wrote

Quote:
>Is there a way to make access wait until the document is printed?
>can I wait for the printspooler to be emptied?

Take a look at Q160129 in the Knowledge Base.

  -- Dev



Sat, 20 Sep 2003 05:19:15 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Printing Queue: How many jobs and job names???

2. Combining multiple print jobs into one job/ActiveReports Problem

3. JOBS JOBS JOBS JOBS !!!!!!

4. Purge print jobs from the print queue

5. Purge print jobs from the print queue

6. Printing multiple reports as a single print job (or email)

7. Help! Remove Print Jobs in Print Queue

8. How do I Print a form 3 times as 1 Print Job of 3 pages, instead of 3 print jobs ?

9. Source Print (Blows Code Print Pro and Pretty Print out of the water)

10. Source Print (Blows Code Print Pro and Pretty Print out of the water)

11. Source Print (Blows Code Print Pro and Pretty Print out of the water)

12. current time of execution during this execution.

 

 
Powered by phpBB® Forum Software