Dim strPrintServer As String
strPrintServer = "localhost"
Dim WMIObject As String, PrinterSet As Object, Printer As Object
WMIObject = "winmgmts://" & strPrintServer
PrinterSet = GetObject(WMIObject).InstancesOf("win32_Printer")
For Each Printer In PrinterSet
MsgBox(PrinterStatusToString(Printer.printerstatus ))
End If
Exit Function
End If
Next Printer
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Vanessa" <va*****@eclinic.com.sg> scripsit: I'm trying to loop through all the printers in my computer system using
WMI.
However, I found out that it doesn't really get the correct number of
printers in my system.
I have 16 printers in my printers & faxes. However, when I use the WMI
to retrieve the printers in my system, it only retrieve 13 printers instead
of 16.
Post your code.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>