• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

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?


0
rajesh_agr
Asked:
rajesh_agr
  • 2
1 Solution
 
DangerizCommented:
How are you printing the report?
Are you using the Printer object?
0
 
DangerizCommented:
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
0
 
zzzzzoocCommented:
"Getting the status of the selected printer from Visual Basic"

http://www.merrioncomputing.com/Programming/PrintStatus.htm
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now