Microsoft KB Archive/66188

Word: Adding Line Numbers to a Print Merge Data Document

PSS ID Number: Q66188 Article last modified on 11-02-1994

5.00 5.50 6.00

MS-DOS

= SUMMARY =

The following procedure can be used to add a field containing record numbers to a Word print merge data document. Numbering the records in the data document makes it easier to identify and print specific records.

= MORE INFORMATION =

A Word data document consists of two parts: the header record and the data records. The header record contains the field names and the data records are the lines of information to be merged into the main document. The following is an example of a data document that includes record numbers:

number,title,first_name,last_name,address,city,state,zip 1. ,Mr.,John,Smith,123 Main St.,Anytown,PA,12345 2. ,Dr.,Jane,Noland,45 Peachtree Lane,Summerville,MA,98787

To add record numbers to an existing data document, load the data document into Word and follow these steps;

  Place the cursor at the beginning of the header record (the first line of the data document).   Type a new field name followed by a comma or a tab (use the same record delimiter that is currently used in the data document). The example above uses the field name titled “number”.   Choose Replace (ESC, R) from the Word Command menu, enter the following settings exactly as shown, and press ENTER: REPLACE text:^p with text:^p1. , confirm: yes (no) case: yes (no) whole word: yes (no) Please note that there is a space between the “1.” and the comma.   Choose Library Number Update (ESC, L, N, U).   Press CTRL+PGDN and delete any numbers that are not located before a record of information (that is, a number on a line by itself).   Save the changes to the data document by choosing Transfer Save. 

Note: The main document for a print merge does not require that all of the fields from the data document be used. The number field will be merged into the main document only if the field is included in the main document ( <> ). For more information about creating merged documents with Word version 5.0, refer to Chapter 18 of the “Using Microsoft Word” manual.

To add line numbers to a data document in Word versions 5.5, 6.0, follow these steps:

  Place the cursor at the beginning of the header record (the first line of the data document). </li>  Type a new field name followed by a comma or a tab (use the same record delimiter that is currently used in the data document). The example above uses the field name titled “number”. </li>  Choose Edit Replace (ALT, E, E) and enter the following settings: Text to Search for:^p Replace with:^p1. , Press the TAB key until the Confirm Changes box is selected, and press the SPACEBAR to remove the X. Choose OK. </li>  In version 6.0, choose Tools Number (ALT, L, N), ensure that Numbered List, Separator: None, and Start At: Auto are selected, and choose OK. For 5.5, choose Utilities Renumber (ALT U, R). Select All and Restart Sequence and choose OK. </li>  Press CTRL+END and delete any numbers that are not located before a record of information (that is, a number on a line by itself). </li>  Save the changes to the data document with File Save. </li></ol>

KBCategory: kbother KBSubcategory: kbmerge Additional reference words: ============================================================================= Copyright Microsoft Corporation 1994.