WD: Using Print Merge to Create a List Sorted by CategoryLast reviewed: February 23, 1998Article ID: Q97795 |
The information in this article applies to:
SUMMARYYou can use the Print Merge command in Word for Windows to create a list of data sorted by category. This article contains instructions and a sample you can use to create such a list.
MORE INFORMATIONUse the following procedure to create a list of items sorted by category:
{SET Place1 {MERGEFIELD CITY}}
{SET place1 {MERGEFIELD CITY}} {IF{place2}<>{place1} "{MERGEFIELD City} <paragraph mark> {MERGEFIELD Employee} {MERGEFIELD Sales}" "{MERGEFIELD Employee} {MERGEFIELD Sales}"} {SET place2 {MERGEFIELD CITY}} Word Version 6.0 ---------------- In order for the example above to work with Word 6.0, you must replace the "{SET place1..." entry with:
{Set place1 {if {mergeseq} = 1 "" "{mergefield city}"}} Notes for all versions: a. For this method to work properly, information other than the above fields must be entered in the header or footer of the main document. b. "<paragraph mark>" means you should press ENTER to insert a paragraph mark. c. The first SET field assigns the current city name to the bookmark Place1. d. The IF field comparison determines whether the CITY field is the same as the previous CITY field. If the expression evaluates to True (different city), the result is the City, Employee, and Sales fields. If the expression evaluates to False (same city), the result is the Employee and Sales fields. e. For the first record, the comparison evaluates to False because the Place2 bookmark has not yet been assigned a value; as a result, the City field prints. In each subsequent record, the value for the previous CITY is held in the Bookmark Place2. a. Activate the FormLetters1 document. b. From the Edit menu, choose Replace. c. In the Find What box, type "^12" (without the quotation marks). d. Clear the contents of the Replace With box. e. Choose the Replace All button. f. Choose the Close button. The resulting list appears as follows:
Atlanta Smith $3,000 Gates $50,000 Henderson $10,000 Houston Jones $8,000 Kelley $9,000 Peterson $0 REFERENCES"Microsoft Word for Windows User's Guide," version 2.0, pages 611-651
|
Additional query words: invoice catalog phone directory conditional mail
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |