Second Expression in Conditional Print Merge Statement

Last reviewed: July 30, 1997
Article ID: Q66612
The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c

SUMMARY

When doing a print merge in Microsoft Word for Windows, the NEXTIF and SKIPIF fields may be used as conditions for merging a specific record with the merge document. The asterisk may be used in the second expression to represent a string of characters, and therefore may not be used as a flag character in the data document.

MORE INFORMATION

For example, to merge a specific number of records that are distinguished by a certain character in a heading called a flag, a sample data document could be set up with the following headings

   name,street,city,state,zip,flag

where "flag" would be a character included in all records to be merged and printed out.

In the main document, the line

   {SKIPIF {flag} <> "character"}

would be included after the data field with the result of merging and printing out each record that contained "character" (without quotation marks) under the flag heading. This statement works for any character with the exception of the asterisk (*). The asterisk is reserved to represent a string of characters (to compare the first expression in the conditional statement with anything that follows the *). Therefore, setting "character" in the above example to * would result in merging and printing all records, whether the record had * in the heading column or not.

Reference(s):

"Microsoft Word for Windows User's Reference," page 98.


KBCategory: kbusage
KBSubcategory: kbfield kbmerge
Additional query words: winword winword2


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: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.