Using "And", "Or", "Attn" in an IF Statement in Print Merge

Last reviewed: July 30, 1997
Article ID: Q68043
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, 6.0, 6.0a, 6.0c

SUMMARY

When you compile a print merge in Word for Windows, you may want to place a specific word in front of another word in certain circumstances. For example, you may want to place the word "and" in front of the wife's name when the husband's name is present, as follows:

   John
   Jane
   John and Jane


The following nested IF statement will meet that condition:

   {If {husb} <> "" "{husb} {if {wife} <> "" "and {wife}"}""{wife}"}

You can alter this statement for "or", "attn", etc. by substituting the bookmark {company} (for husb), {contact} (for wife) and substituting "attention" (without the quotation marks) or any other appropriate word.


KBCategory: kbprint
KBSubcategory: kbmerge
Additional query words: 1.x 2.0 2.0a word6
winword 2.0a-CD 2.0b 2.0c 6.0 6.0a 6.0c winword2
Keywords : kbmerge
Version : 1.x 2.x 6.0
Platform : WINDOWS


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.