Postup:
Do modulu zapiÜt∞:
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 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
Public Const PRINTER_CONTROL_PURGE = 3
Sub DeletePrinterJob()
Dim PrinterName$
Dim ret&
Dim hPrinter&
PrinterName = Printer.DeviceName
ret = OpenPrinter(PrinterName, hPrinter, 0)
ret = SetPrinter(hPrinter, 0, vbNull, PRINTER_CONTROL_PURGE)
ret = ClosePrinter(hPrinter)
End Sub
|