Hello,
This might not be the answer you are looking for but I am wondering if the
reason for wanting the list of available printers is so that the user can
select the required printer. If so, then the following displays the printer
selection and setup dialog box.
Application.Dialogs(xlDialogPrinterSetup).Show
--
Regards,
OssieMac
"Ken" wrote:
The code found in the this article works in Excel as well.
http://word.mvps.org/FAQs/MacrosVBA/...lePrinters.htm
Here is a list of printers the code generated on my PC:
Quicken PDF Printer
Microsoft XPS Document Writer
Microsoft Office Document Image Writer
HP Photosmart 2600 series
Generic / Text Only
DYMO LabelWriter 330 Turbo
DELL3110cn-417FC9-PS
DELL3110cn-417FC9
Dell Laser Printer 1700n PS3
Adobe PDF
The issue I'm having is that the name listed is not the name needed in order
to reference one of the printers. This is because windows always adds "on
NeXX", where XX is a number such as 04, to the end of every printer name.
Therefore, "Adobe PDF" is really "Adobe PDF on Ne04" for instance. This is
true for all printers and I've tried it on multiple PCs.
If someone could modify this code or supply provide different code that
returns the actual full printer names it would be very helpful.
Additionally, if you would provide a way to always select/reference the
desired printer based on the short name. For instance, return the full name
of the printer name that starts with "Adobe PDF".
Thanks,
Ken