[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Check if a printer is working before sending a print job to it

Posted on 2009-02-18
3
Medium Priority
?
246 Views
Last Modified: 2013-11-28
We had a situation where a problem occurred because for some reason there was not communication between a users and printer.  Is there any way in code to check to see if that communication exists before sending a print job in code?  Currently, we are prompting the user with:
  If MsgBox("The current default printer is " & Application.Printer.DeviceName & ". Do you want to proceed?", vbYesNo) = vbNo Then      Exit Sub
  End If
To allow then to change the printer but this does not let us know if the communication exists.
0
Comment
Question by:troyvw
  • 2
3 Comments
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 23673678
Not that I know of.

Remember that Windows normally spools the print jobs. This means that applications then "see" the printer as ready because the spooler will accept the print job even before trying to send it on to the printer.

/gustav
0
 
LVL 58
ID: 23673913
Here's a link to a MSKB article which contains the code you need:
http://support.microsoft.com/kb/202480 
JimD.
0
 
LVL 52

Accepted Solution

by:
Gustav Brock earned 1000 total points
ID: 23675770
Well, nearly exact what I wrote:

<quote>
NOTE: The system only checks the status when the system has a job to spool. Otherwise, the queue is considered "ready" because the queue can accept jobs, even if the hardware is in an error state. For example, if the last job that was printed used the last piece of paper, the operating system does not know this until the system tries to print again.
<snip>
.. a queue that displays "Ready" does not guarantee that your print job will complete successfully.
</quote>

The only reliable method is to print via an external true printer server - in "the old days" a Novell NetWare printer server. Today you would probably choose a Linux or Windows file/print server.
This will spool any print job to a queue until the printer is ready. The printer may be off-line, even physically disconnected; as soon as the printer is ready, the server starts printing from the queue. If a job is interrupted for whatever reason, it will be reprinted when the printer is brought back on-line.
One printer queue may service more than one physical printer. If one printer is busy or off-line, printing will be directed to the other printer.

/gustav
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

829 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