troyvw
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.Device Name & ". 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.
If MsgBox("The current default printer is " & Application.Printer.Device
End If
To allow then to change the printer but this does not let us know if the communication exists.
Here's a link to a MSKB article which contains the code you need:
http://support.microsoft.com/kb/202480
JimD.
http://support.microsoft.com/kb/202480
JimD.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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