WD: How to Test a Field For Text or Number in Print MergeLast reviewed: February 5, 1998Article ID: Q77892 |
The information in this article applies to:
SUMMARYWhen preparing a Microsoft Word for the Macintosh print merge, sometimes it is necessary to check a field to determine if the field contains a number or text before performing an action. To determine whether a field contains text, a number, or is blank, use the following command:
<<IF fieldname>> <<IF fieldname>"999999999">> Action if fieldname is text <<ELSE>> Action if fieldname is number or if fieldname is blank <<ENDIF>> <<ELSE>> Action is fieldname is blank <<ENDIF>> MORE INFORMATIONThis method looks at numbers as a text strings. For example, the number 10 is considered to be smaller than the number 9. However, the number 99 is correctly considered to be greater than the number 9. In the above example, the limit value is 999999999. If a data document's greatest number has 5 characters, such as 93748, you must use 99999 as the limit value. A string of zeros always is seen as a number. Using a large value like 999999999 as your limit value should force Word to pick up all numbers in a data document. NOTE: Spaces in a field are considered as numbers; spaces separated by tabs or commas are considered blank. Some punctuation marks are considered numbers, others are considered text. The following is a partial list:
Number: . , ! # $ % & * ( ) Text: ? @ ^ |
Additional query words: database limits
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |