rajesh_agr
asked on
Printer Online/Offline
Through my VB application I wants to test that printer is online/offline
before printing the report.
Could anyone please let me know how to test it?
before printing the report.
Could anyone please let me know how to test it?
if you are using the Print object in VB then there ISN'T a method you can use which allows you check for printer online/offline status. It will just take send print commands to the default printer on that machine.
All you have to do to accommodate this is to use proper error handling...
Private Sub Command1_Click()
On Error GoTo ErrorHandler ' Set up error handler.
Printer.Print "Testing printer connectivity" ' Send Print command.
Printer.EndDoc
Exit Sub
ErrorHandler:
MsgBox "There was a problem printing to your printer." & vbCrLf & _
"Please check your your printer connectivity."
Exit Sub
End Sub
All you have to do to accommodate this is to use proper error handling...
Private Sub Command1_Click()
On Error GoTo ErrorHandler ' Set up error handler.
Printer.Print "Testing printer connectivity" ' Send Print command.
Printer.EndDoc
Exit Sub
ErrorHandler:
MsgBox "There was a problem printing to your printer." & vbCrLf & _
"Please check your your printer connectivity."
Exit Sub
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you using the Printer object?