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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting a List of Printers

Status
Not open for further replies.

Kaulana

Technical User
Jul 31, 2001
24
US
I would like to be able to let the user choose which printer to print to, but need to know how to get the list of printer defaults into the program. I know that Application.ActivePrinter will give me the active printer name, but how to get the other printers to put into a dropdown list? This is similar to what you see after clicking Print (for an Excel sheet) and then you see the Printer section of the Print box. There you can select the other printers connected to the computer. HOW do I access that list, please?

Thanks in advance
 
This should do the trick very nicely. Enjoy:

Private MyPrinters As Printer


'add all installed printers to combo box (if any)
If VB.Printers.Count <= 0 Then
cboPrinters.AddItem &quot;No Printer(s) Installed&quot;
Else
For Each MyPrinters In Printers
cboPrinters.AddItem MyPrinters.DeviceName
Next
End If
cboPrinters.ListIndex = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top