OLE – Enumerate Printers

This script uses OLE  to list the available printers to the Report Panel

newscript

Dim objNetwork = CreateObject("WScript.Network")
Dim objPrinters = objNetwork.EnumPrinterConnections

' Strange, but this seems to be one of those implementations of a collection
' that does not ENUMERATE correctly
' Send the results to the REPORT PANEL
dim enumObj
for each enumObj in objPrinters
olemap = enumObj
Next enumObj
report() ' empty the report panel
' have to iterate through the items
dim i
for i = 0 to (objPrinters . count - 1 )
report = i & " " & objPrinters.item(i)
next i

report ' display the report panel