Home All Groups Group Topic Archive Search About

How many jobs are waiting in the printer's queue

Author
16 May 2006 1:23 AM
Jim
Using VB.NET I would like to know if there is a way to get the jobs in a
printers queue. I am printing from the word interop and want to close my word
interface after I have printed all the jobs I have requested.

I am using PrintOut to print the document and an envelope then quitting the
application. I never get the envelop printed unless I stop the application
long enough for the first document to complete printing. I want to loop
through the jobs in the queue until there are none left then quit the
application.
--
Thanks, Jim

Author
16 May 2006 3:50 AM
Ken Tucker [MVP]
Hi,

        You can use the wmi's win32_printjob class to get a list of that.

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

Simple wmi example
http://www.vb-tips.com/default.aspx?ID=694ce28d-4551-40c8-a0a0-673c63efa8cc

Ken
--------------------
Show quoteHide quote
"Jim" <J**@discussions.microsoft.com> wrote in message
news:C193A79A-358C-4A15-86BE-78D3A1869378@microsoft.com...
> Using VB.NET I would like to know if there is a way to get the jobs in a
> printers queue. I am printing from the word interop and want to close my
> word
> interface after I have printed all the jobs I have requested.
>
> I am using PrintOut to print the document and an envelope then quitting
> the
> application. I never get the envelop printed unless I stop the application
> long enough for the first document to complete printing. I want to loop
> through the jobs in the queue until there are none left then quit the
> application.
> --
> Thanks, Jim