WD: Print Merge Only Certain Records from a Data Document

Last reviewed: November 17, 1997
Article ID: Q29193
The information in this article applies to:
  • Microsoft Word for the Macintosh, versions 3.0, 3.01, 3.02
  • Microsoft Word for the Macintosh, version 4.0
  • Microsoft Word for the Macintosh, versions 5.0, 5.1

SUMMARY

In Microsoft Word, you can print a form letter for records that contain only certain data.

MORE INFORMATION

To do this you can specify a range of records in the Merge dialog box, or you can use one of the following methods (use the method appropriate for your version of Word).

Word for the Macintosh 5.0, 5.1

Use an IF instruction to test each record before printing. For example, if you only want to print those records that have "NY" for a state field, set up the main document as follows:

   <<Data filename>><<IF state="NY">>
   .
   .   Text of form letter goes here, with other merge
   .   instructions.
   .
   <<ENDIF>>

Word for the Macintosh 3.0, 4.0

Use an IF instruction to test each record before printing. For example, if you only want to print those records that have "NY" for a state field, do the following:

  1. Set up the main document as follows:

          <<Data filename>><<IF state="NY">>
          .
    
          .   Text of form letter goes here, with other merge
          .   instructions. Note the manual page break
          .   (SHIFT+ENTER) that comes before the ENDIF.
          .
          --------------------------------------------------------
          <<ENDIF
    
    

  2. On the Format menu, click Section.

  3. Under Section Start, click No Break. Click OK.

In Word versions 4.0 and 3.0, it is important to remove the closing >> after the ENDIF.

Note that the ENDIF must be on the last line of the document; otherwise, extra blank lines will be printed for those records that do not meet the screening criteria. A manual page break (SHIFT+ENTER) must immediately precede the ENDIF instruction so that each form letter will be printed on a separate page.


Additional query words: selected
Keywords : kbfield kbmerge macword word8 word97 kbualink97
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a;MACINTOSH:3.0,3.01,3.02,4.0,5.0,5.1,5.1a,6.0 ,6.0.1,6.0.1a
Platform : MACINTOSH WINDOWS
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.