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" <(E-Mail Removed)> wrote in message
news:53589CA3-B9CB-459D-BD4F-(E-Mail Removed)...
> 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
|