Click to See Complete Forum and Search --> : Checking if printer is available


Alexander Kempf
March 27th, 2001, 08:25 AM
Hi everyone,

I'm trying to write a routine that
finds out if a chosen printer
(set printer = p) is available, e.g.
if the printer is valid, switched on
has enough paper etc.
Has anyone any idea how to do this?
I tried some of the WinAPI-functions
but didn't quite succeed.
Any help would be appreciated.

Thanks in advance,

A. Kempf

cksiow
March 27th, 2001, 08:02 PM
you can query the printer in your system

Dim X As Printer
For Each X In Printers
Debug.Print X.DeviceName
Next

hope this help

cksiow
http://vblib.virtualave.net - share our codes

Alexander Kempf
March 28th, 2001, 02:25 AM
Thanks,

but the problem is not to find out
which printers are available in the
system. If you choose one of the
printers in the printers collection
you don't know if this particular
printer is plugged in or if it's
switched on etc. The problem is
when you start printing on a printer
which is not ready for printing
you won't get an error immediately.
In the worst case you'll never get
an error message.
If you got any other ideas please
let me know and again thanks.

A. Kempf