Results 1 to 6 of 6

Thread: Pausing/Resuming Windows Print Queue

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    244

    Pausing/Resuming Windows Print Queue

    Does anyone know how (in VBA) to pause a print queue and then unpause it again?

    I have an Excel macro that I need to pause the queue with, let a lot of jobs collect in the queue and then the last command sent by the macro is to resume the queue but I cannot for the life of me find the code.

    Thanks,

    Jim

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I've found this little EventVB.dll file which has those options in which you can call on. The file itself can be downloaded from:
    http://www.merrioncomputing.com/Download/index.htm

    with a how to use it help guide here:
    http://www.merrioncomputing.com/Even...iPrintJob.html

    as well as the full source code here:
    http://www.merrioncomputing.com/Even...tJob_CODE.html

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    244
    In reading it, it looks like you can only pause an individual jobs but not an entire queue. Have you found this to be true?

    Thanks,

    Jim

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I've never done this myself to be honest with you, but looking at the api's available I would think that you're right. You should be able to loop through each of the print jobs & pause them in one go though - maybe using the EnumJobs api call to do this:

    http://www.mentalis.org/apilist/EnumJobs.shtml

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    244
    I am starting to think that there are no easy native VBA functions to pause a windows spooler. (Equiv of Rt Clicking on a printer in the Printers Folder and select "Pause Printing". Thanks for the assistance.

  6. #6
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Using the eventVB.dll, the class ApiPrinter has pause/resume functionality and the class ApiPrintJob ditto.

    They are wrappers for the SetPrinter and SetJob API calls respectively.
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width