Hi Tom,
You almost certainly don't need the COMPARE expression. Plus, Word's AND
expression is limited to combining two statements. An alternative construct,
which avoids both the COMPARE expression and the AND expression, is:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}*{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}= 1 “Both conditions met” “At least one condition not met”}
Here, the '*' performs the same function as an AND expression. You can
simply keep adding more statements, thus:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}*{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}*{IF{MERGEFIELD Field_Three}= "Cond3" 1 0}= 1 “All conditions
met” “At least one condition not met”}
A slight variation on this allows you to create the equivalent of an OR
expression:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}+{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}> 0 “At least one condition met” “No conditions met”}
and:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}+{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}+{IF{MERGEFIELD Field_Three}= "Cond3" 1 0}> 0 “At least one
condition met” “No conditions met”}
or even:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}+{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}+{IF{MERGEFIELD Field_Three}= "Cond3" 1 0}> 1 “At two conditions
met” “At least two conditions not met”}
Here, the '+' performs the same function as an OR expression. Plus, as you
can see from the last example, it allows you to do much more than a simple
OR expression ever could.
Cheers