Welcome! Log In Create A New Profile

Advanced

Getting printer status

Posted by Arie 
Arie
Getting printer status
August 02, 2010 09:47PM
The code below can be used to read the status of all printers, like in start-settings-printers.
You need to add System.Printing to the dotnet list of your project.

pclLps is LocalPrintServer dynamic
pclLps = new LocalPrintServer
pclEnu is IEnumerator dynamic
PcliEnumObject is PrintQueueCollection dynamic
PcliEnumObject = pclLps:GetPrintQueues()
pclEnu = PcliEnumObject:GetEnumerator()
bOK is boolean = pclEnu:MoveNext()
pq is PrintQueue dynamic
WHILE bOK
	pq = pclEnu:Current
	Trace(pq:FullName,pq:NumberOfJobs,pq:HasPaperProblem,pq:IsDoorOpened,pq:IsNotAvailable,pq:IsOffline,pq:IsInError,pq:IsPaperJammed,pq:IsOutOfPaper,pq:NeedUserIntervention,pq:IsTonerLow)
	bOK = pclEnu:MoveNext()
END

btw: in WD15 you can skip the IEnumerator steps and use FOR EACH directly
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: