On Fri, 17 Feb 2006 09:57:25 -0500, David E. Jones wrote in
microsoft.public.access.macros:
>I'd like to automate printing a report to a pre-selected Acrobat pdf
>file name. I've set the printer for the report to use the specific
>printer "Acrobat PDF." When previewing the report, and selecting Print,
>a popup box will always prompt for a location and filename. I'd like to
>specify the filename, and print to that filename, overlaying an existing
>one if present.
>
>My old method of printing to an rtf file via a macro doesn't work, since
>output to pdf isn't native to Access, unless I missed something in the
>install.
>
>I'm using Access 2003 and Acrobat 7.0.
You need:
1) a Reference to Acrobat Distiller (ACRODIST.EXE);
2) set the printer to "Acrobat Distiller";
3) print your report as a Postscript file;
4) define a PDFDistiller object;
5) convert the PS file to PDF using the FileToPDF method of the
PDFDistiller object;
6) clean up (delete PS file, reset printer to default).
There are plenty of examples on the Internet and Usenet. I posted some
skeleton code for Excel here:
<http://groups.google.com.au/group/microsoft.public.access/browse_frm/thread/233394b566500b71/73a70a6ee8868107>.
--
Michael Bednarek
http://mbednarek.com/ "POST NO BILLS"