Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dom Dom is offline
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date expressions Khardy3352 Microsoft Word Help 1 November 26th 07 06:30 AM
which statement right , question is Choose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 16th 06 11:15 AM
which statement right , question isChoose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 15th 06 11:20 PM
Combining DDE Expressions Ademar Mailmerge 5 November 12th 05 07:23 PM
IF Statement using multiple Expressions with Bolean Viperpurple Mailmerge 3 December 19th 04 02:33 PM


All times are GMT +1. The time now is 07:15 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"