Printing/Outputing to PDF File

  • Thread starter Thread starter MJ
  • Start date Start date
M

MJ

Using: AC2003 & Adobe Acrobat Pro

I have come up with a way to print report(s) by setting the Print Object
default for each desired output Report to PDF Printer and using:

DoCmd.OpenReport "MyReport", acViewNormal

This accomplishes the desired results with user interface REQUIRED to select
where and what file name.

While this works, it is NOT what I would really like it to happen. Is the a
way that I can do it such that I can code the location and the file name?
Is there was a way to use:

DoCmd.OutputTo acOutputReport, "MyReport", acFormatPDF, "location and
filename"

When I have tried it, the "acFormatPDF" errors off, any ideas or suggestions?

Thank you in advance,
 
In older versions of Adobe PDFWriter 5.x and lower you could control it
through the registry and supply the filename and suppress the dialogs.
Newer versions
are more difficult to deal with. Most people either use the PDF routine at
http://www.lebans.com/reporttopdf.htm or control the registry
settings and use a PDF printer driver of their choice. I like win2pdf.
There are a bunch of PDF printer drivers.

I have samples of registry controlling code in the Email module at
www.rptsoftware.com
also you can get help at win2pdf.com. Note the email module also has
routines to do batch reporting (example: creating pdf files for 500
customers) where
at runtime sometimes you need a simple where clause, sometimes you need
something trickier like completely new sql for the query(s) that drive the
report.
I have been using it for years in a product which serves up pdf files to the
web.

HTH,
Mark
RPT Software
http://www.rptsoftware.com
 
Back
Top