MyLady


Hey,

How do I, with vba code, call for all installed printers in my computer and then display them in a ListBox

Best Regards

Cathrine




Re: How do I call for all installed printers....

Mario B


I don't think it is possible to find out all installed printers:(.

You can get only the active printer using Application.ActivePrinter property.

To add items to a ListBox in Excel, you do something like this:

Sub addlistbox()
Dim lb As ListBox
Set lb = Sheet1.ListBoxes.Add(10, 10, 100, 100)
lb.AddItem (Application.ActivePrinter)
lb.AddItem ("more text")
lb.AddItem ("more text2")

End Sub







Re: How do I call for all installed printers....

Andy Pope

Hi,

In Excel you can make use of the built in dialog.

Application.Dialogs(xlDialogPrinterSetup).Show

Which application are you using







Re: How do I call for all installed printers....

MyLady

Hey,

Thanks for your replies.

Excel 2003.

If VBA only have the ActivePrinter solution, is there a API call I can use

Cath





Re: How do I call for all installed printers....

Andy Pope

Have a look here.
http://vbnet.mvps.org/index.html code/forms/setlayeredwindowattributes.htm





Re: How do I call for all installed printers....

magicalclick

This is a link PSHK gives me awhile back. It works like a charm.

http://word.mvps.org/FAQs/MacrosVBA/AvailablePrinters.htm