#1
|
|||
|
|||
Printer Listing
Is there a way in Excel VBA to create a listing of all of the printers available to that PC. In other words, I'd like to be able to loop through all of the printers that are available in Device Manager so that I can select one that is not the default printer based on some criteria that I could define and print to it instead
|
#2
|
||||
|
||||
|
#3
|
|||
|
|||
Thanks
Thanks.
My version of Excel does not support the Printers property of the Application Object so I get an error on Dim prtLoop As Printer and Printers.Count Is there some other way that would work with an previous version of Excel? |
#4
|
||||
|
||||
No version of Excel supports a Printers property, but you can use WMI:
Code:
Dim Printer As Object For Each Printer In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2"). _ ExecQuery("Select * from Win32_Printer") MsgBox Printer.Name Next |
#5
|
|||
|
|||
Thanks
Works perfectly. Thanks for the help
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
listing | johan-leroy | Excel | 1 | 11-26-2016 08:12 AM |
Printer Problems-Need to reload printer each day | jekronenfeld | Windows | 1 | 11-24-2014 12:35 AM |
listing linked graphics | eng1ne | Drawing and Graphics | 5 | 02-28-2012 06:42 AM |
MS Word 2003, printer queue in 'printer properties' shows 1 job; no job in printer | benhuxham | Word | 0 | 07-25-2011 06:58 PM |
listing and counting words | gencoglux | Word | 2 | 05-07-2010 05:10 PM |