View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken[_27_] Ken[_27_] is offline
external usenet poster
 
Posts: 24
Default How can I get a list of the available printer names

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