General discussion

Locked

VBA Code Change Printer Within Access 97

By Ldufresne19 ·
I need to Print about 20 reports daily unsing Acrobat Distiller 5.0 which is installed on my PC. I am trying to create VBA Code that will change the printer to be Acrobat Distiller before the reports start to print, but I am havig trouble writing the code. I have tried "ActivePrinter = "Acrobat Distiller on LPT1" but this does not work.
I am looking for VBA code to do this change so that I can print all 20 reports nightly.

Lou Dufresne

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VBA Code Change Printer Within Access 97

by DKlippert In reply to VBA Code Change Printer W ...
Collapse -

VBA Code Change Printer Within Access 97

by Ldufresne19 In reply to VBA Code Change Printer W ...

Thanks for this assistance. The site you mentioned has great solutions for developers.

Collapse -

VBA Code Change Printer Within Access 97

by sanie In reply to VBA Code Change Printer W ...

Hi there,

You could try to use this code:

Sub SwitchPrinter()
Dim strActivePrinter As String
' Get active printer.
strActivePrinter = Application.ActivePrinter
' Change to the Microsoft Fax printer driver.
Application.ActivePrinter = "Microsoft Fax"
' Print the active document to Fax.
ActiveDocument.PrintOut
' Change back to the default printer.
Application.ActivePrinter = strActivePrinter
End Sub


I got this from a microsoft site.

Try it...

Collapse -

VBA Code Change Printer Within Access 97

by Ldufresne19 In reply to VBA Code Change Printer W ...

Sanie,
Unfortunately this code did not work. I receive an error message " Method Active Printer of Object_Global failed". Run-Time-Error '1004'.

Collapse -

VBA Code Change Printer Within Access 97

by Ldufresne19 In reply to VBA Code Change Printer W ...

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums