WD2001: Word 5 Merge Document with IF Comparisons Does Not Automatically Translate into Word 98 and Word 2001 (275350)



The information in this article applies to:

  • Microsoft Word 98 Macintosh Edition
  • Microsoft Word 2001 for Macintosh

This article was previously published under Q275350

SYMPTOMS

When you use Word 98 Macintosh Edition or Word 2001 for the Macintosh to open a Microsoft Word 5.x for Macintosh print merge document, some of the conditional statements do not compare data fields correctly.

CAUSE

This issue can occur if the Word 5.x document has a conditional print merge command such as
<<IF Country="USA">>
				
and Word 98 and Word 2001 do not correctly convert that command to the new form, which is as follows:
{IF {COMPARE {MERGEFIELD Country} = "USA"}= 1 }
				

WORKAROUND

To work around this issue, alter all conditional print merge commands in the Word 5.x document to a format that later versions of Word can properly translate.

For example, search for equal (=) signs, and then place parentheses around each equation that you find. As an illustration, the following statement is how the conditional merge statement appears in Word for Macintosh 5.1:
<<IF Country="USA">>
				
If the statement in this form is converted by a later version of Word for the Macintosh, it appears like this:
{IF {MERGEFIELD Country}= "USA" = 1 "" ""}
				
After you alter the code so that both sides of the equation are included between a set of parentheses, the conditional merge command is converted correctly. The statement
<<IF (Country="USA")>>
				
becomes:
{IF {COMPARE {MERGEFIELD Country} = "USA"}= 1 }
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

The original statement from Word 5.x returns a value of True if the mergefield Country contains the value USA.

In the current merge comparison, the statement must specify that Country is a mergefield and the statement must use the Compare function to determine whether the value for the current record in the Country field is equal to USA. If it is true, then the Compare function returns the value of 1, which the IF statement compares with the number 1 (True).

Modification Type:MajorLast Reviewed:10/14/2002
Keywords:kbbug kbinterop kbProgramming KB275350