View Single Post
  #11   Report Post  
Greg Maxey
 
Posts: n/a
Default

Yes, this unwieldy:

{ IF { = OR(OR(OR(OR(OR(OR({ Compare "{ County }" = "Pinellas" }, { Compare
"{ County }" = "Hillsborough" }), { Compare "{ County }" = "Lake" }), {
Compare "{ County }" = "Orange" }), { Compare "{ County }" = "Brevard" }),
{ Compare "{ County }" = "Indian River" }), { Compare "{ County }" =
"Volusia" })} = 1 "Test Sat""Test Fail" }

:-)

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Peter Jamieson wrote:
try

{ IF { =or({ COMPARE "{ MERGEFIELD "County" }" = "Hillsborough" },
{ COMPARE "{ MERGEFIELD "County" }" = "Pinellas" }) } = 1
"Test positive" "Test Negative" }

if you ave a thrid comparison, you will need a second OR, e.g.

{ IF { =or(or({ COMPARE "{ MERGEFIELD "County" }" = "Hillsborough" },
{ COMPARE "{ MERGEFIELD "County" }" = "Pinellas" }) ,
{ COMPARE "{ MERGEFIELD "County" }" = "County3" }) } = 1
"Test positive" "Test Negative" }

Unwieldy, isn't it?

Just a suggestion, but if you are inserting form a separate file you
might be better off using the result of the { =} field as part of the
file name, e.g. if you have

Counties0.doc

and

Counties1.doc

you might use

{ INCLUDETEXT "c:\\mydocs\\Counties{{ =or(or({ COMPARE "{ MERGEFIELD
"County" }" = "Hillsborough" },
{ COMPARE "{ MERGEFIELD "County" }" = "Pinellas" }) ,
{ COMPARE "{ MERGEFIELD "County" }" = "County3" }) }.doc"

or you can use 2 bookmark names within a single file to achive
something similar.

Peter Jamieosn
"Lara Z" wrote in message
...
Yes, obviously, but if this is a valid operator what is the syntax
for using it - either in general or with my example, as everything I
have tried has not worked...?? I tried the following and it does not
work, i.e., does not return "Test Positive" or "Test Negative" .

{ IF { = OR ({MERGEFIELD "County"}="Hillsborough", {MERGEFIELD
"County"}="Pinellas")} =1 "Test Positive" "Test Negative"}


"smcash" wrote in message
...
I'm new to this stuff, but as far as I can tell the operator is
simply: Or

-smcash




"Lara Z" wrote:

I am trying to code a merge document that will insert an additional
two-page
document if the 'COUNTY' field is one of eight counties. The
additional document is the same for all eight counties. In
WordPerfect this could be
done simply with the SWITCH/ENDSWITCH construct. I know there is no
equivalent in Word, but is there any easier way to do this than
doing eight
back-to-back IF statements with the same (redundant) two pages of
text inserted in each "then" part of the IF statement? Is there an
OR operator in
Word that might help accomplish this?