Solved

Printer Online/Offline

Posted on 2004-04-15
6
378 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 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