Hi,
In addition to what Naomi and Craig said...
There is a good source at msdn:
http://msdn.microsoft.com/en-us/library/aa394363(VS.85).aspxand, although it is written in german, you might have a look at my blog entry about this:
http://tomsvfpblog.blogspot.com/2009/12/druckerstatus-abfragen.htmlhttp://tomsvfpblog.blogspot.com/2010/04/druckerstatus-abfragen-teil-2.html>I want to find the printer status Like ONLINE, OFFLINE, OUT OF PAPER etc.
>
>SYS(13) always return ready even when the printer is off ( because of spooling)
>
>I tired the code below it shows PrinterStatus = 3 for all available printer
>
>
>
>lcComputer = '.'
>loWMIService = Getobject('winmgmts:' ;
> + '{impersonationLevel=impersonate}!\\' + lcComputer + '\root\cimv2')
>
>*!* loInstalledPrinters = loWMIService.ExecQuery ;
> ("Select * from Win32_Printer Where PrinterStatus = '1' or PrinterStatus = '2'")
>
>loInstalledPrinters = loWMIService.ExecQuery ;
> ("Select * from Win32_Printer ")
>
>For Each loPrinters In loInstalledPrinters
>CLEAR
>
>? loPrinters.GetObjectText_
>? loprinters.Name
> wait
>Next
>
>RETURN
>
>
>
>Thanks in Advance
Best Regards
-Tom
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011