How to use VBA to set duplex printing on or off

Article contributed by Ibby

The best way of doing this is by using API calls. The following article gives you a VB code sample which does this:

Q230743

Only one problem with this code: It is written for VB and uses Printer.DeviceName to return the name of the currently selected printer. In Word VBA, you need to substitute this with ActivePrinter. The problem is that the strings returned by these commands are slightly different, even though they both get the name of the printer from the name assigned in Control Panel | Printers. For instance.:

ActivePrinter:
    HP LaserJet 6L PCL on LPT1:

Printer.DeviceName:
    HP LaserJet 6L PCL

So you'll need to test and modify the code sample accordingly.

If you don't want to use API calls, however, you can install a duplicate printer driver with the duplex property set and print to that (by changing the ActivePrinter).


Click to view Terms of Use page

Click to view Disclaimer page