LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 38
Default List of printers

Hi

I'd like to get a array of all installed printers incl. the connected port.
The array should look like this:

HP LaserJet 6P on LPT1:
Adobe PDF on Ne03:
SnagIt 6 on Ne00:


I already have the following procedure, but this code doesn't return the
connected port:

Private Sub ListPrinters()
Dim wshNetwork As Object
Dim oDrives As Object
Dim oPrinters As Object
Dim iCount As Integer
Dim sCurrentprinter As String
sCurrentprinter = Application.ActivePrinter
Set wshNetwork = CreateObject("WScript.Network")
Set oDrives = wshNetwork.EnumNetworkDrives
Set oPrinters = wshNetwork.EnumPrinterConnections
For iCount = 0 To oPrinters.Count - 1 Step 2
Debug.Print oPrinters.Item(iCount + 1)
Next
End Sub


Many thanks in advance.

Tom


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of available printers prizm1 New Users to Excel 3 June 12th 05 01:32 PM
list o installed printers Arkaad Excel Programming 1 September 14th 04 10:52 AM
How to get the available printers list in a macro [email protected] Excel Programming 3 March 5th 04 02:54 PM
Creating a printers list PO Excel Programming 2 November 14th 03 01:51 PM
List of Printers Bret Holle Excel Programming 1 September 27th 03 04:39 PM


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"