Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer Status
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01118502
Message ID:
01118795
Views:
105
Here is one using WMI
strComputer = "."
strComputer = "."
objWMIService = Getobject("winmgmts:"+ "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
colInstalledPrinters = objWMIService.ExecQuery("SELECT * FROM Win32_Printer")
For Each objPrinter In colInstalledPrinters
?"Name: " + objPrinter.Name
Do Case
Case objPrinter.PrinterStatus = 1
strPrinterStatus = "Other"
Case objPrinter.PrinterStatus = 2
strPrinterStatus = "Unknown"
Case objPrinter.PrinterStatus = 3
strPrinterStatus = "Idle"
Case objPrinter.PrinterStatus = 4
strPrinterStatus = "Printing"
Case objPrinter.PrinterStatus = 5
strPrinterStatus = "Warmup"
Endcase
? "Printer Status: " + strPrinterStatus
Next
>>Yes, such function exists - GetPrinter. I already have a code that returns printer status using GetPrinter function.
>
>Does it work reliably? Can you post the code?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform