Incorrect Results Using Wildcards in Selective Print Merge

ID: Q88774

The information in this article applies to:

SUMMARY

If you use wildcard characters, such as the asterisk (*) or question mark (?), in the criteria for a selective print merge operation, the results of your print merge may be incorrect or incomplete. This problem occurs if you use wildcards followed by an ordinal number in numeric format to define the selection criteria in the NEXTIF, SKIPIF, or IF fields.

MORE INFORMATION

Word for Windows evaluates ordinal numbers in numeric format, such as 24th or 21st, as integers instead of text. This leads to incorrect print merge results when an ordinal number follows a wildcard.

For example, the following statements may produce incomplete or incorrect print merge results because a numeric ordinal number follows the wildcard (?):

   {skipif {MERGEFIELD address} <> "????24th Ave."}
   {nextif {MERGEFIELD address} <> "????21st Ave."}

However, the following statements produce correct and complete print merge results because non-ordinal alphabetic or numeric characters, or ordinal numbers in alphabetic format follow the wildcard (?):

   {skipif {MERGEFIELD address} <> "????Microsoft Way"}
   {nextif {MERGEFIELD address} <> "????39 Stars Street"}
   {nextif {MERGEFIELD address} <> "????Twenty-First Street"}

Workarounds

To work around this behavior, change the syntax of numeric records to alphabetic. The following is an example:

   "235 24th Ave." becomes "235 Twenty-Fourth Ave."
   "235 21st Ave." becomes "235 Twenty-First Ave."

 -or-

In the data document, place the data that contains a numeric ordinal number in a separate field so that it can be evaluated without using wildcard characters. The following is an example:

   -----------------------            ------------------------------
   |ADDRESS              |            |STREET1   | STREET2         |
   |---------------------|  becomes   |----------|-----------------|
   |235 24th Ave.        |            |235       | 24th Ave.       |
   |---------------------|            |----------|-----------------|
   |235 21st Ave.        |            |235       | 21st Ave.       |
   -----------------------            ------------------------------

For more information on using wildcards to perform a selective print merge in Word for Windows, query on the following words in the Microsoft Knowledge Base:

   and wildcard and selective and records

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

Last Reviewed: February 6, 1998