Home All Groups Group Topic Archive Search About

How to.... Question.....

Author
9 Mar 2006 4:37 PM
Pete Smith
How to query the printer about out of paper or paper jam or any other error
message.
I have written a print application which does the printing.
VB.Net and .Net Framework 1.1. Windows 2000 Professional/Windows 2000
Server.
Thank you,
Pete

Author
9 Mar 2006 10:22 PM
Ken Tucker [MVP]
Hi,

        Check out Carls midi tools

http://training.franklins.net/dotnet.aspx

Ken
---------------------

Show quoteHide quote
"Pete Smith" <PeteSmit***@hotmail.com> wrote in message
news:uPycBe5QGHA.1204@TK2MSFTNGP12.phx.gbl...
> How to query the printer about out of paper or paper jam or any other
> error
> message.
> I have written a print application which does the printing.
> VB.Net and .Net Framework 1.1. Windows 2000 Professional/Windows 2000
> Server.
> Thank you,
> Pete
>
>
Author
9 Mar 2006 11:15 PM
Ken Tucker [MVP]
Hi,

        Sorry about that I posted the answer to the wrong question.

Take a look at the WMI win32_printer class.  There is a Detected Error State
property which contains the info you are looking for

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_printer.asp

        Dim arErrorInfo() = _
            {"Unknown", "Unknown", "Other", "No Error", _
             "Low Paper", "No Paper", "Low Toner", _
             "No Toner", "Door Open", "Jammed", "Offline", _
             "Service Requested", "Output Bin Full"}

        Dim moReturn As Management.ManagementObjectCollection
        Dim moSearch As Management.ManagementObjectSearcher
        Dim mo As Management.ManagementObject

        moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Printer")

        moReturn = moSearch.Get

        For Each mo In moReturn
            Dim strOut As String
            Dim intError As Integer = CInt(mo("DetectedErrorState"))
            strOut = String.Format("Name {0} - {1}", mo("Name"),
arErrorInfo(intError))
            Trace.WriteLine(strOut)
        Next


Ken
----------------
Show quoteHide quote
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%23QcO0f8QGHA.1328@TK2MSFTNGP10.phx.gbl...
> Hi,
>
>        Check out Carls midi tools
>
> http://training.franklins.net/dotnet.aspx
>
> Ken
> ---------------------
>
> "Pete Smith" <PeteSmit***@hotmail.com> wrote in message
> news:uPycBe5QGHA.1204@TK2MSFTNGP12.phx.gbl...
>> How to query the printer about out of paper or paper jam or any other
>> error
>> message.
>> I have written a print application which does the printing.
>> VB.Net and .Net Framework 1.1. Windows 2000 Professional/Windows 2000
>> Server.
>> Thank you,
>> Pete
>>
>>
>
>