G Scott
asked on
Printer Status Incorrectly Reporting
So I have found code that returns the status of a printer. There are many solutions on this site in regards to this and most people are happy with the results. However, this does not seem to work correctly for me. Here is what I am using. I have 3 printers installed. Two are network printers and one is a USB directly on the PC.
These report as follows. Idle, Unknown, Idle. The USB one (default) is currently not connected to the printer yet still results with an 'idle'. Is this something I may be doing wrong. Is there a more accurate way of doing this? Thanks for any input.
I have a ref to System.Management with this code as well:
These report as follows. Idle, Unknown, Idle. The USB one (default) is currently not connected to the printer yet still results with an 'idle'. Is this something I may be doing wrong. Is there a more accurate way of doing this? Thanks for any input.
I have a ref to System.Management with this code as well:
Dim strPrintServer As String
strPrintServer = "localhost"
Dim WMIObject As String
Dim PrinterSet As Object
Dim Printer As Object
WMIObject = "winmgmts://" & strPrintServer
PrinterSet = GetObject(WMIObject).InstancesOf("win32_Printer")
For Each Printer In PrinterSet
MsgBox( _
Printer.Name & ": " & _
(Printer.PrinterStatus) _
)
Next
PrinterStatus.jpg
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER