tags:

views:

4

answers:

0

I have a Windows printer configured using a PPD based driver.

The PPD file defines Duplex as being supported and the duplex setting can be changed via the Printer's Printing Preferences (right click on the printer and choose properties). I have confirmed the setting works by printing a two page document.

The problem I have is reading the Printer's duplex setting using WMI

Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
Set colPrinters = objWMIService.ExecQuery ("Select * From Win32_Printer WHERE Name='My Printer'")
dDuplex=false
For Each objPrinter in colPrinters
 For Each i in objPrinter.Capabilities
  If i=3 Then
   bDuplex=true;
  End if
 Next
Next

The duplex capability is never set even though the printer is printing in duplex.

Can anybody help with a method for retrieving the duplex setting for a Printer configured using PPD?