Resuming Print Jobs

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

After a print job has been paused, that job must be resumed before the document will be printed. You can resume the print job programmatically by using the Resume method of the IADsPrintJobOperations interface.

For the most part, the Resume method works only on print jobs that were paused before they started printing. If you pause a print job while it is printing, it is likely that the document will not actually be paused but will continue printing. If the document is larger than the print buffer, however, it is possible that only part of the document will be printed and then the print job will be paused. If a document has printed partway and then paused, resuming the print job will not cause printing to pick up where it left off. Instead, the entire document will be reprinted.

Scripting Steps

Listing 13.15 contains a script that resumes all the print jobs on a computer. To carry out this task, the script must perform the following steps:

  1. Use a GetObject call to bind to the printer ArtDepartmentPrinter on the print server atl-ps-01.
  2. Use the PrintJobs method to set the value of the variable colPrintJobs.

    This variable will now contain a collection consisting of all the print jobs in the ArtDepartmentPrinter print queue.

  3. For each print job in the collection, use the Resume method to resume printing the document.

Listing 13.15   Resuming Print Jobs

1 2 3 4 5 
Set objPrinter = GetObject("WinNT://atl-ps-01/ArtDepartmentPrinter") Set colPrintJobs = objPrinter.PrintJobs For Each objPrintJob in colPrintJobs     objPrintJob.Resume Next

send us your feedback Send us your feedback « Previous | Next »   


Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 635

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net