Private Sub Command1_Click()
Dim result As Boolean
result = False
Dim hPrinter As Long
Dim dwNeeded, dwReturned As Long
Dim b(1000) As Byte
If OpenPrinter("hp LaserJet 1010", hPrinter, ByVal 0&) = 0 Then
Exit Sub
End If
EnumJobs hPrinter, 0, &HFFFFFFFF, 1, b(0), 1000, dwNeeded, _
dwReturned
MsgBox "有" & dwReturned & "个打印任务!"
If Not SetPrinter(hPrinter, 0, ByVal 0&, PRINTER_CONTROL_PAUSE) Then
MsgBox "失败"
Else
result = True
End If
ClosePrinter hPrinterend sub为什么老是用setprinter控制打印机暂停---失败?
Dim result As Boolean
result = False
Dim hPrinter As Long
Dim dwNeeded, dwReturned As Long
Dim b(1000) As Byte
If OpenPrinter("hp LaserJet 1010", hPrinter, ByVal 0&) = 0 Then
Exit Sub
End If
EnumJobs hPrinter, 0, &HFFFFFFFF, 1, b(0), 1000, dwNeeded, _
dwReturned
MsgBox "有" & dwReturned & "个打印任务!"
If Not SetPrinter(hPrinter, 0, ByVal 0&, PRINTER_CONTROL_PAUSE) Then
MsgBox "失败"
Else
result = True
End If
ClosePrinter hPrinterend sub为什么老是用setprinter控制打印机暂停---失败?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货