A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

OR statement for more than 2 expressions



 
 
Thread Tools Display Modes
  #1  
Old April 4th, 2008, 11:14 AM posted to microsoft.public.word.mailmerge.fields
Dom
external usenet poster
 
Posts: 82
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  
Old April 4th, 2008, 02:37 PM posted to microsoft.public.word.mailmerge.fields
Graham Mayor
external usenet poster
 
Posts: 18,297
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.