Ryali
asked on
Detecting a Printer through VB code
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check each printer's driver name:
If Printer.DriverName = sEmpty Then
MsgBox "Driver for printer is missing.", vbExclamation
Exit Sub
End If
If Printer.DriverName = sEmpty Then
MsgBox "Driver for printer is missing.", vbExclamation
Exit Sub
End If
ASKER
Theoretically good but practically average solution. We should write a method to capture the list of printers.
ASKER