Microsoft KB Archive/69780

Excel for OS/2: Tips for Changing Printer Setup in OS/2 PSS ID Number: Q69780 Article last modified on 02-26-1993 PSS database name: W_eXceL

2.20 2.21 3.00

OS/2

Summary:

It is possible to change the printer settings from an Excel for OS/2 macro by using the SEND.KEYS macro command. However, the process required to change these settings is different than that required in Windows.

It is necessary to send the TAB character a number of times to get to the particular section of the printer driver setup screen you want to change. This is a limitation of the way the OS/2 printer drivers are written and not a limitation of Excel.

More Information:

The following portion of macro code will change the orientation of the page of the LaserJet IID driver of IBM OS/2 1.3 to landscape:

=SEND.KEYS(“%s{TAB 2}%l”) =PRINTER.SETUP?

The SEND.KEYS statement above makes use of four distinct sections, each of which has a specific purpose. The %s selects the Setup button of the Printer Setup dialog. The {TAB 2} presses the Tab button twice to get to the Orientation section of the LaserJet Job Properties dialog. The %l selects Landscape from this section. The tildes simply sends an ENTER sequence twice.

Sending the {TAB} sequence is required because the printer driver will not allow the use of a hotkey without making the section active. To change the duplex printing option on this driver, for example, would require a SEND.KEYS statement that looked like:

=SEND.KEYS(“%s{TAB 5}%b”)

Note the you need to press the Tab button five times to get to the 1 or 2 Sided Printing Section and %b selects the 2 Sided Book option.

For more information on changing printer setup options, query on the following keywords:

Excel and Printer and Setup and Send and Keys

Copyright Microsoft Corporation 1993.