Microsoft KB Archive/104410
Excel: Using LINE.PRINT to Change Global and Document Settings
The information in this article applies to:
- Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0
In Microsoft Excel, you can use the LINE.PRINT() function to set the global line printing options in the EXCEL4.INI file (EXCEL5.INI file in version 5.0). You can also set the document line printing options for an individual document.
If you set the LINE.PRINT() command argument to 1, you can print the active document using Lotus 1-2-3-compatible methods. However, unless you have a specific need to use the LINE.PRINT() function, use the PRINT() function instead.
Microsoft provides macro examples for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This macro is provided 'as is' and Microsoft does not guarantee that the following code can be used in all situations. Microsoft does not support modifications of the code to suit customer requirements for a particular purpose.
Changing the Global Settings in the EXCEL4.INI (or EXCEL5.INI) File
To change the global settings in the [Line Print] section of the EXCEL4.INI (or EXCEL5.INI) file, do either of the following:
- Use a text editor (such Windows Notepad) to manually change the settings in the EXCEL4.INI (or EXCEL5.INI) file.
Change the settings with the LINE.PRINT() macro function:
1. Open a new macro sheet.
2. On the macro sheet, type the following:
A1: =LINE.PRINT(6,,0,132,,,,,,,TRUE) A2: =LINE.PRINT(1) A3: =RETURN()
- A1 changes the global settings such that the left margin is 0 and the right margin is 132. The last argument updates the settings in the EXCEL4.INI (or EXCEL5.INI) file. After this line is executed, the [Line Print] section will have the following settings:
[Line Print] Comment=This section controls Lotus macro line printing settings. Options=66 LeftMarg=0 RightMarg=132 TopMarg=2 BotMarg=2 PgLen=66 Setup=
- A2 prints the active document, which uses the settings changed in the previous line.
Changing the Settings for the Active Document Only
To change only the active document's settings without making changes to the EXCEL4.INI (or EXCEL5.INI) file, use Syntax 2 of the LINE.PRINT() function:
This function will change the document settings (when you run this macro, the document you want to change must be active).
The default settings for the [Line Print] section of the EXCEL4.INI (or EXCEL5.INI) file are shown below:
[Line Print] Comment=This section controls Lotus macro line printing settings. Options=2 LeftMarg=4 RightMarg=76 TopMarg=2 BotMarg=2 PgLen=66 Setup=
NOTE: These settings may be different for your file if you have made changes to the default settings.
"Online Help," version 5.0
"Function Reference," version 4.0, pages 253-254
Additional query words: 4.0 4.00a 5.0
Version : 4.00 4.00a 5.00
Platform : WINDOWS
Issue type :
Last Reviewed: April 7, 1999