Rutine returning alle available printers

E

Ebbe

In a VBA-macro I have to know, what printers are available on the particular
computer.
Do anyone know some VBA/API-code, that can give me the wanted information?

Ebbe
 
D

Doug Robbins - Word MVP

Getting names of available printers” at:

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


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
E

Ebbe

Thank you Doug!

I discovered that it only helped me half the way.
I am working on a way to get information about what paper trays the printers
on the computer has.
I have all the code that gives me information about ActivePrinter.
This code uses both the printers name and its port.

When i use: "x = ActivePrinter"
I get a name like: "\\server\printer on PORT:"
Is there a way to get the printers port without changing the ActivePrinter
and get it this way?

Ebbe
 
D

Doug Robbins - Word MVP

Hi Ebbe,

See the article “Changing the selected (current) printer in Word without
changing the system default printer” at:

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

Also take a look at the series of articles written by fellow MVP Jonathon
West at

http://pubs.logicalexpressions.com/Pub0009/LPMFrame.asp?CMD=ArticleSearch&AUTH=20

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
E

Ebbe

Dear Doug!
Thanks for the quick reply.
I know the articles from MouseTrax. It is these routines that works by using
ActivePrinter because it delivers the portname of the printer.
My problem is, that I know the printername of the printer and want the
portname without having to change ActivePrinter.
Is it possible?

Ebbe
 

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