List of available printers

P

prizm1

I am trying to develop a form that will dynamically find and list all
available printers including the default printer. From this form I want
to select which printer will be assigned to Application.ActivePrinter.
How do I write a macro to provide the names of all available printers?
 
D

Don Guillett

Does this help?

Sub getprinters()
Application.Dialogs(xlDialogPrinterSetup).Show
End Sub
 
P

prizm1

That's something I can resort to, just displaying the Print dialog and
having the user select from their list of printer names.

The thing is, as I change workstations, the printers available to me
from the on-network Excel file I'm designing can change. Some stations
have the network printer as default while others have a locally attached
printer as default. I am trying to create a form that offers the user a
choice between the locally attached printer and the network printer. It
would be great if I could access the Print Dialog Name drop-down list of
printers directly in VBA and import them into a list box user form
unique to that workstation. The form would list both the network printer
and the printer local to that workstation (just as the Print dialog
does)with the local printer attached to that particular comp being
different from what would be listed for a different workstation with a
different locally attached printer.

Since the Macro Recorder can "extract" the printer names, I assume that
there must be some obscure VBA code I can manually enter to get at these
local, unique-station printer names directly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top