![]() |
Leading the way in Microsoft Office Development |
| Home | | | Excel | | | Word | | | PowerPoint | | | VBA | | | SharePoint | | | Consultancy | | | Newsletter | | | Contact |
| Word > Fields > Mail Merge > COMPARE |
| COMPARE expression1 operator expression2 | |
| Compares two values and displays the result "1" if the comparison is true or "0" (zero) if the comparison is false. |
| expression1 | Values to compare Expressions names, strings of text, numbers, nested fields that return a value, or mathematical formulas If an expression contains spaces, enclose the expression in quotation marks. | |
| expression2 | Values to compare Expressions can be bookmark names, strings of text, numbers, nested fields that return a value, or mathematical formulas If an expression contains spaces, enclose the expression in quotation marks. | |
| operator | Comparison operator Insert a space both before and after the operator = Equal to <> Not equal to > Greater than < Less than >= Greater than or equal to <= Less than or equal to |
| REMARKS |
| EXAMPLES | |
| { COMPARE " { MERGEFIELD PostalCode } " = "985*" } { IF { = OR ( { COMPARE { MERGEFIELD CustomerNumber } >= 4 }, { COMPARE { MERGEFIELD CustomerRating } <= 9 } ) } = 1 "Credit not acceptable" "Credit acceptable"} |
| Fields - C | Index - C | Mail Merge | Office Online |
| Copyright © 2011 Better Solutions Limited. All Rights Reserved. | Top |