Print Report to Distiller

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

I'm trying to print a report using Acrobat 5 Distiller. I
can do it manually but want to code it from a command
button on a form (Access 2000). The code below keeps
getting a compile error: "Method or Data Member not Found"
when it gets to "Application.ActivePrinter"

Dim printer As String
printer = Application.ActivePrinter
Application.ActivePrinter = "Acrobat Distiller"
....

Am I missing a Reference? I just want to use VBA to
switch to store the original printer setting, switch to
the Distiller printer, and then reset back to the default
printer. Is this harder than I'm giving it credit for?

Thank you in advance,
Al
 
Al:

A printer is an object rather than a string. To set the Application to a
specific printer you do it this way:

Dim objPrinter As Printer
For Each objPrinter In Application.Printers
If objPrinter.DeviceName = "Acrobat Distiller" Then
Application.Printer = objPrinter
End If
Next

If you want a way to automate output of your reports to distiller to a
specific file name then look at our PDF and Mail Library for Access on our
web
 
Back
Top