Link to home
Create AccountLog in
Avatar of G Scott
G ScottFlag for United States of America

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.

User generated imageThese 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

Open in new window

PrinterStatus.jpg
ASKER CERTIFIED SOLUTION
Avatar of hjgode
hjgode
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of G Scott

ASKER

I see what you mean. These are Intermec prints and I think they offer an activeX control to get statuses.  Thanks for clarifying.