The Line Print Subkey

The following is a list of entries in a typical Line Print subkey:

BotMarg
Comment
LeftMarg
Options
PgLen
RightMarg
Setup TopMarg

This section controls settings used in Lotus 1-2-3 macro line printing. These settings are defined using the various Lotus 1-2-3 Worksheet Global Default Printer (/wgdp) commands and are updated in the Line Print subkey whenever Microsoft Excel encounters a Lotus 1-2-3 Worksheet Global Default Update (/wgdu) command.

The LeftMarg, RightMarg, TopMarg, and BotMarg entries control the respective margin settings. The values for LeftMarg and RightMarg refer to numbers of characters. While these two values can be from 0 to 1000, a standard page is 80 characters wide. The values for TopMarg and BotMarg refer to numbers of lines. While these two values can be from 0 to 240, standard 11-inch paper can accommodate a maximum of 66 lines, as indicated by the PgLen entry.

The Setup entry is equivalent to the Lotus 1-2-3 Worksheet Global Default Printer Settings (/wgdps) command and specifies the printer setup string.

The Options entry controls four global settings using an 8-bit binary number entered in hex format. Each bit is either 0, corresponding to N (no); or 1, corresponding to Y (yes). The following table lists the values used with the Options entry.

Bit

Lotus 1-2-3 /wgdp command

0

Wait

1

Formatted

2

AutoLf

3

Port (0 through 7)

4

(Used for port)

5

(Used for port)


The best way to determine the appropriate decimal number to use with the Options entry is to construct the binary number first and then convert it to a hex value. The default value is 0x00000002(2) or, in binary, 0000 0010,  meaning that bit 1 is set to the value 1 (the Formatted option set to Y) while all others are set to zero (N). For example, the Options entry that is written to the registry when bits 0, 1, and 2 are set to 1 (0000 0111) is the hex value 0x00000007(7), meaning that the Wait, Formatted, and AutoLf options are set to Y.

The three bits (3, 4, and 5) that are devoted to the port indicate the setting used by Lotus 1-2-3 to specify the hardware port to be used for printing. With Microsoft Excel, this is interpreted as a logical port. The default port setting is LPT1:, meaning that bits 3, 4, and 5 are all set to zero. The following table shows the binary bit and port settings.

Binary value (bits 3, 4, and 5)

Port

xx00 0xxx

LPT1:

xx00 1xxx

COM1:

xx01 0xxx

LPT2:

xx01 1xxx

COM2:

xx10 0xxx

LPT1:

xx10 1xxx

LPT2:

xx11 0xxx

LPT3:

xx11 1xxx

LPT4:


Note that in the preceeding table, LPT1: and LPT2: are each represented twice. Either combination of bits can be used with equivalent results.

The actual hex value entered in the Options entry depends on the combination of all the values in the preceding table. For example, if both the Formatted and AutoLf settings are turned on (bits 1 and 2 set to 1), and COM2: is the specified port (bits 3 and 4 set to 1), the Options entry value 0x0000001E(30) is written to the Line Print subkey, which is equivalent to the binary number 0001 1110.

Note

To assist you in translations between binary and decimal numbers, you can use the BIN2DEC and DEC2BIN add-in functions that are part of the Analysis ToolPak that is shipped with Microsoft Excel 97. To load these functions, open the ADDINFNS.XLA macro sheet, located in the LIBRARY\ANALYSIS subdirectory of the directory where Microsoft Excel is installed.