Print Access Report as PDF with Acrobat 6

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Tony_VBACoder (anonymous_at_discussions.microsoft.com)
Date: 08/24/04


Date: Tue, 24 Aug 2004 11:15:56 -0700

Since upgrading from Acrobat 5 to Acrobat 6, my code that
I used to use to print an Access 2000 Report as a PDF
using the "PDFWriter" printer, which now with Version 6 of
Acrobat does not exist, no longer works. With Acrobat
Version 5, my sample code is (minus any functions that
browse for folders and read/write to the Windows Registry):

1) Ask the user where they would like to store the reports:
sFolderName = BrowseFolder("Select a Folder to Export the
PDF Report to:", sCurrentDBPath)

2) Build the PDF File Path:
sFileAttachment = sFolderName & "\" & sPDFFileName & ".pdf"

3) Read the current default printer and save the value -
we will need this later when we reset the Default Printer
sMyDefPrinter = dhReadRegistry
(HKEY_CURRENT_USER, "Software\Microsoft\Windows
NT\CurrentVersion\Windows", "Device")

4) Change the default printer to the PDF Writer:
dhWriteRegistry
(HKEY_CURRENT_USER, "Software\Microsoft\Windows
NT\CurrentVersion\Windows", "Device", "Acrobat PDFWriter")

5) Set the value for PDFFileName in the registry Prints
the Report without the dialog box from appearing:
dhWriteRegistry(HKEY_CURRENT_USER, "Software\Adobe\Acrobat
PDFWriter", "PDFFileName", sFileAttachment)

6) Open the Report so it will print it:
DoCmd.OpenReport sReportName, acViewNormal

7) Change the Printer from PDF Writer back to the default
printer:
dhWriteRegistry
HKEY_CURRENT_USER, "Software\Microsoft\Windows
NT\CurrentVersion\Windows", "Device", sMyDefPrinter

Now, with Acrobat Version 6, the "PDFWriter" printer has
gone away, along with the Windows Registry entries, and
now it appears that I must first print my Access Report as
a PostScript format (*.ps) and then use the Distiller
printer to convert (print) it to a PDF.

If anyone has any sample code that shows me how to do
this, it would be much appreciated as I am in a time
crunch to convert what used to work under 5.0 to 6.0.

Thanks.



Relevant Pages

  • Print Access Report to PDF V6 or V7, using VBA - is this a secret?
    ... I have an Access 2000 application using Acrobat 5, that prints a report to ... PDF using VBA code, that works great. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Print Access Report as PDF with Acrobat 6
    ... You are correct that PDFWriter is not in Acrobat 6 and that there are no ... registry entries to control the Adobe PDF printer. ... Check out our PDF and Mail Library that does support Acrobat 6 ...
    (microsoft.public.access.reports)
  • Re: Printing to the Acrobat PDFWriter
    ... PDFWriter came with Acrobat 5.0. ... I use it all the time to create PDF files ... I also had Distiller that came with Acrobat 5. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Acrobat 7 and FoxPro
    ... I don't know anything about the Adobe Acrobat control you mention. ... However, if you want to print from VFP to a PDF file, why not use PDF995 as ... Demo showing how to print a Fox report to a PDF ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Linking a pdf
    ... combined with specific versions of Acrobat support this capability well. ... Object and choose Create from File and it will insert the pdf document on ... your report and print well. ...
    (microsoft.public.access.reports)