Results 1 to 4 of 4

Thread: Delete a Printer Job

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Lisbon, Portugal
    Posts
    55

    Post

    Hi!

    Anyone knows how do I kill a Printer job from the queue?
    Thanks for your help


    [email protected]

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Brooklyn NY USA
    Posts
    1,258

    Post Delete printer queue with api

    PUT IN THE MODULE
    Sub delpri()
    r = Printer.DeviceName
    a = OpenPrinter(r, hPrinter, 0)
    b = SetPrinter(hPrinter, 0, vbNull, PRINTER_CONTROL_PURGE)
    c = ClosePrinter(hPrinter)
    End Sub


    Public Declare Function SetPrinter Lib "winspool.drv" Alias "SetPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, pPrinter As Byte, ByVal Command As Long) As Long
    Public Const PRINTER_CONTROL_PURGE = 3
    Public Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long
    Public Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long


    WHENEVER YOU CALL THE SUB 'DELPRI' ALL FILES READY TO PRINT WILL BE DELETED/
    THE SAME AS SELECTING PURGE PRINT DOCUMENTS IN THE PRINTER FOLDER

    [email protected]

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Post

    KillDoc might work too!?

  4. #4
    New Member
    Join Date
    Aug 2000
    Location
    NY
    Posts
    1

    Unhappy I could use some help!!

    Hi,
    I am currently working on a project where I have incorporated a "simple" printer manager. The last leg is to create a delete printjob function (please note I am fairly new to VB, about 8 months). I have attempted using "Printer.killdoc" but it didn't work (everytime I clicked the command button nothing happened. Also note that Windows Print Manager is handling the printing). After a lot of searching I came across your sample above. I tried it out but I am encountering the same results as the "Printer.killdoc" nothing happens when I click the command button.

    Does anyone one have any suggestions? or Shed some light on this for me?

    Any help would be greatly appreciated.

    Thanks,
    Joshua L. Ingram
    [email protected]

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