Printing outside of excel and selecting printers

A

ArmsteR

HI all and thanks in advance for your time to read and hopefully
answer the quandry I'm in.

I have been trying to develop a macro that I can embed into a whole
bunch of existing Drawing register files. which have lists of upto 50
drawings per workbook within the spreadsheet. What I need to be able
to do is find a way that will allow me to select via the Windows API a
list of available printers. From this I will be using an if statement
to select the relevant printer dependant on the size of the drawing to
be printed off. I will be mainly controlling adobe acrobat reader and
DWF viewer. So my original paths of using the printto verb didn't seem
to be working.

Many thanks in advance

David Armstrong
 
S

Steve Yandl

David,

WMI might not be the best option if you will be running your routine on PCs
with Win98 or earlier OS but otherwise it is simpler to use than Windows
API. The routine below could probably be modified to give you what you
need.

__________________________________

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")

For Each objPrinter In colPrinters
MsgBox objPrinter.Name
Next objPrinter
__________________________________

Steve
 

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