Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
zz zz is offline
external usenet poster
 
Posts: 14
Default detect all printers in networks

Is it possible to detect all active printers in a network directory?, i need to display them all in a listview control in a userform, this is the first time i'm attempting to do this so i don't know how it could be done.


--
--
---
ZZ [underground]
Semi-musico,cuasi-poeta y loco
  #2   Report Post  
Posted to microsoft.public.excel.programming
zz zz is offline
external usenet poster
 
Posts: 14
Default detect all printers in networks

great!!

easier than i thougth , but i'm not sure i understand it


dissectioning

first: a reference to ("wscript.network"), i'm assuming it is the local
computer's network configuration we're reading here?

second : the EnumPrinterConnections method/function returns an array
containing all the printers connected to 'this' computer, since it only
retrieves the Printers installed on 'this' machine [there are thousands
of printers in the server's directory].

third : you loop trough all items in the array, which are actually
objects? of the type printer?

so, the printer.item( i ) actually retrieves the port to wich printer
is connected/assigned and then the name of the printer would be
printer.item(i+1)?



i wonder if this could be done to read all printers available for install in
the server's directory


thanks a lot.


--
--
---
ZZ [underground]
Semi-musico,cuasi-poeta y loco


"Tom Ogilvy" wrote in message
...
Sub a()
Set WshNetwork = CreateObject("WScript.Network")
' Set oDrives = WshNetwork.EnumNetworkDrives
Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 0 To oPrinters.Count - 1 Step 2
Debug.Print "Port " & oPrinters.Item(i) & " = " & _
oPrinters.Item(i + 1)
Next
End Sub


perhaps.

--
Regards,
Tom Ogilvy


"zz" wrote:

Is it possible to detect all active printers in a network directory?, i
need to display them all in a listview control in a userform, this is the
first time i'm attempting to do this so i don't know how it could be
done.


--
--
---
ZZ [underground]
Semi-musico,cuasi-poeta y loco



Reply
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
Chose two printers with vba Matos Excel Programming 1 May 7th 06 05:43 PM
HELP: how to detect if printers are installed? woes :S KevinGPO Excel Worksheet Functions 1 March 14th 06 09:58 AM
HELP: how to detect if printers are installed? woes :S KevinGPO Excel Programming 1 March 14th 06 09:58 AM
Printers Jason Zischke Excel Programming 4 December 1st 05 02:05 AM
Printers & LPT Tom Excel Programming 0 November 26th 03 05:39 PM


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

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

About Us

"It's about Microsoft Excel"