Detecting a Printer through VB code

Ryali
Ryali used Ask the Experts™
on
To detect whether a printer is installed in the network i have writen the below code.

Dim oInstalledPrinter       As VB.Printer

For Each oInstalledPrinter In VB.Printers
      mblnPrinterExists = True
      Exit For
Next ' oInstalledPrinter



But with this code even FAX machine is also accepted as printer.
Can any one help me out
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
none
Project manager
Commented:
A faxmachine is also a printer. If you get the name on a list or something, just filter this one out.

Commented:
Check each printer's driver name:

If Printer.DriverName = sEmpty Then
   MsgBox "Driver for printer is missing.", vbExclamation
   Exit Sub
End If

Author

Commented:
Theoretically good but practically average solution. We should write a method to capture the list of printers.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial