Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2006

Tip: Looking for answers? Try searching our database.

OR in a mergefield?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Compass Rose - 11 Apr 2006 18:56 GMT
I would like to use OR in an If...then...else... Word Field.

If {MERGEFIELD Company} = "Company A" OR {MERGEFIELD Company} = "Company B"
OR {MERGEFIELD Company} = "Company C" then......

Is it possible, and if so, what is the correct syntax?

TIA
David
Peter Jamieson - 11 Apr 2006 20:15 GMT
There is no OR  in the IF field, but there are other ways to achieve the
same effect, depending on exactly what you need.

{ IF "{ MERGEFIELD Company }" = "Company A" "X" "Y" }
{ IF "{ MERGEFIELD Company }" = "Company B" "X" "Y" }

is one way that may be enough in simple situations.

{ COMPARE "{ MERGEFIELD Company }" = "Company A"  } returns 1 if Company is
"Company A", 0 otherwise, so you can use

{ IF { =or({ COMPARE "{ MERGEFIELD Company }" = "Company A"  },{ COMPARE
"{ MERGEFIELD Company }" = "Company B"  })  } = 1 "X" "Y" }

or just use addition, e.g.

{ IF { ={ COMPARE "{ MERGEFIELD Company }" = "Company A"  }+{ COMPARE "{
MERGEFIELD Company }" = "Company B"  }  } > 0 "X" "Y" }

Peter Jamieson
>I would like to use OR in an If...then...else... Word Field.
>
[quoted text clipped - 6 lines]
> TIA
> David
Graham Mayor - 12 Apr 2006 06:04 GMT
There is an alternative method for testing for a value in fields shown at
http://www.gmayor.com/formatting_word_fields.htm

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> There is no OR  in the IF field, but there are other ways to achieve
> the same effect, depending on exactly what you need.
[quoted text clipped - 26 lines]
>> TIA
>> David
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.