Printer Online/Offline

Posted on 2004-04-15
Medium Priority
Last Modified: 2006-11-17
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?

Question by:rajesh_agr
  • 2

Expert Comment

ID: 10831383
How are you printing the report?
Are you using the Printer object?

Expert Comment

ID: 10831619
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.
   Exit Sub
   MsgBox "There was a problem printing to your printer." & vbCrLf & _
            "Please check your your printer connectivity."
   Exit Sub
End Sub
LVL 17

Accepted Solution

zzzzzooc earned 200 total points
ID: 10848733
"Getting the status of the selected printer from Visual Basic"


Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question