I received following code to check if the printer is switched on or off
Function PrinterOnline(sPrinter$) as Boolean
Dim i%
On Error GoTo errHandler
i = InStr(sPrinter, " on ")
If i > 0 Then sPrinter = Left(sPrinter, i - 1)
PrinterOnline = Not GetObject("winmgmts:\\.\root\CIMV2").Get("Win32_Printer='" & sPrinter & "'").WorkOffline
Exit Function
errHandler:
PrinterOnline = False
End Function
The function returns the same result if the printer is switched on or not
Is there an other code that I can use
Thanks
Bookmarks