Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select not default printer

Status
Not open for further replies.

Taxidriver

Programmer
Jan 15, 2002
79
0
0
IT
Hello, how can I choose a printer via code (not the default printer) without changing the default printer?
 
Depending of your version of access you may take a look at the Application.Printers collection and the Application.Printer property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I write
Set Application.Printer = Application.Printers("\\qfax\qfile")
but gives me an error, either the call is not valid or the argument.
 
Ok now it works, I had to put the name of the printer in a variable and the pass it to application.printers. now it's fine, thanks!
 
Is there a command to retrieve automatically the default printer, in order to avoid explicit definitions?
 
From the help file:
Dim prtDefault As Printer
Set prtDefault = Application.Printer
With prtDefault
MsgBox "Device name: " & .DeviceName & vbCr _
& "Driver name: " & .DriverName & vbCr _
& "Port: " & .Port
End With

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top