Export Report to PDF code

  • Thread starter Thread starter PAt G
  • Start date Start date
When you install Adobe Acrobat, "PDF Writer" gets
installed as a printer.

To produce a report as a PDF, simply file, print and
choose the pdf writer as your printer.

hth
johnny
 
Is it possible, through VBA code, to select the pdf printer for the user so
the user don´t have to choose it manually?

And offcource when the printer dialog is closed to set it back to the
default printer.

TIA!
// Niklas
 
Pat:

There's nothing built into Access to allow this to be automated. You can
use a third party library or code like our PDF and Mail Library for Access,
(which requires that you have one of the supported printer drivers on your
machine,) to output a PDF file with as little code as:

Dim objPDF as New PDFClass
With objPDF
.ReportName = "MyReport"
.ReportWhere = "[CustomerID]= " & SomeValue
.OutputFile = "c:\some dir\some file.pdf"
.PDFEngine = 2 'Adobe PDF or Distiller
.PrintImage
End With

You'll find that on our web site.
 
Back
Top