Link to home
Start Free TrialLog in
Avatar of troyvw
troyvwFlag for United States of America

asked on

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

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.
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

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
Here's a link to a MSKB article which contains the code you need:
http://support.microsoft.com/kb/202480 
JimD.
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial