Save a report's output as a PDF file*
| If you have
Adobe Acrobat installed on your machine, you
can output a report to a PDF file for viewing
and easier electronic distribution to users.
Follow these steps to get the various pieces
||Buy and install Acrobat
on the machine(s) where the reports will
||In your Winini file, add
a section like this, if it doesn't
If this section does not exist,
create it. Put it right after the
[Ports] section. The file name line will
get your path and pdffilename; the
bDocInfo line sets a switch so that you
won't get the dialogbox when you print
This zip file contains code for changing
the default printer that Ken
Getz has posted. Import the
modules into your db.
||Add a new module and add
this code (or put this code in an
The legal stuff:
CANNOT BE USED WITHOUT THE COPYRIGHT
INFORMATION, AND YOU MAY NOT MODIFY
THE EXISTING CODE. ADD WHATEVER
CODE YOU LIKE, IF YOU NEED, BUT
LEAVE THE EXISTING CODE INTACT.
Option Compare Database
Private drexisting As aht_tagDeviceRec
Const AcrobatName = "Acrobat PDFWriter"
Const AcrobatDriver = "PDFWRITR"
Const AcrobatPort = "LPT1:"
If ahtGetDefaultPrinter(drexisting) Then
Dim dr As aht_tagDeviceRec
.drDeviceName = AcrobatName
.drDriverName = AcrobatDriver
.drPort = AcrobatPort
Sub ChangePdfFileName(NewFileName As String)
Call aht_apiWriteProfileString("Acrobat PDFWriter", _
||Create the print file.
To do this, add the following lines to
the appropriate place in your code
(perhaps in reaction to a button click):
ChangePdfFileName "Name of pdf file including .pdf"
DoCmd.OpenReport "YourReportName", acViewNormal
*DefaultPrt.zip, which you can download from the www.mcwtech.com site,
does exactly what it was intended to do, for the purpose for which it
was intended. There is no explicit support in that download for Adobe
Acrobat, and you may need information available on the Adobe support web
site for using their printer services with any other product. Please do
not send email requesting support on the use of
Adobe Acrobat, as none can be supplied. (In our experience, the
instructions listed here work fine for some versions of Acrobat, but not
for others, as Adobe appears to have changed their programmatic
interface. For more information on making this tip work in your own
environment, stop by www.adobe.com.)