Solved

Printer Online/Offline

Posted on 2004-04-15
6
349 Views
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?


0
Comment
Question by:rajesh_agr
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Dangeriz
ID: 10831383
How are you printing the report?
Are you using the Printer object?
0
 
LVL 4

Expert Comment

by:Dangeriz
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.
   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
 
LVL 17

Accepted Solution

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

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now