If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
OR statement for more than 2 expressions
Hi,
I would like to use the "OR field code" (probably not using the correct terminology) for 3 expression. It works fine for 2 but can't get it to work with 3. I've used it in my previous job so I know it's possible, but can't seem to find a sample "script" anywhere. Can anyone help? This is what I have (which doesn't work): {IF {= OR ({MERGEFIELD “LetterType”}=”A”, {MERGEFIELD “LeterType”}= “B”, {MERGEFIELD “LeterType”}= “C”)} = 1 “TEXT 1” “TEXT2”} What I want is to print TEXT 1 if LetterType = A or B or C. Thanks in advance for your help. Dom |
#2
|
|||
|
|||
OR statement for more than 2 expressions
Try
{ IF{ =({ IF{ Mergefield "LeterType" } = "A" 1 0 } + { IF{ Mergefield "LeterType" } = "B" 1 0 } + { IF{ Mergefield "LeterType" } = "C" 1 0 })} = 1 "Text1" "Text2" } and change the smart quotes to straight quotes. Shouldn't that be LetterType ? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org dom wrote: Hi, I would like to use the "OR field code" (probably not using the correct terminology) for 3 expression. It works fine for 2 but can't get it to work with 3. I've used it in my previous job so I know it's possible, but can't seem to find a sample "script" anywhere. Can anyone help? This is what I have (which doesn't work): {IF {= OR ({MERGEFIELD "LetterType"}="A", {MERGEFIELD "LeterType"}= "B", {MERGEFIELD "LeterType"}= "C")} = 1 "TEXT 1" "TEXT2"} What I want is to print TEXT 1 if LetterType = A or B or C. Thanks in advance for your help. Dom |
Thread Tools | |
Display Modes | |
|
|