Option Explicit
Sub OhSht()
Dim o As Object, ret
For Each o In GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_Printer")
ret = o.CancelAllJobs
Debug.Print o.Name, ret
Next o
End Sub
Sub interrompreImpression_WinXP()
Dim strComputer As String
Dim objWMIService As Object, colInstalledPrinters As Object
Dim objPrinter As Object
strComputer = '.'
Set objWMIService = GetObject('winmgmts:\\\\' & strComputer & '\\root\\cimv2')
Set colInstalledPrinters = objWMIService.ExecQuery('Select * from Win32_Printer')
For Each objPrinter In colInstalledPrinters
objPrinter.CancelAllJobs
Next
Set objWMIService = Nothing
Set colInstalledPrinters = Nothing
End Sub