Include an or option in IF statement: IF field = _ OR= _ then

A

ARY

MSWord 2003
The "If then Else" is too basic. Should include more options, like 'or' to
automate.
For example, in a familiar salutation: If a person is a Mr. or Ms., we want
to use first name. If a person is a Judge, though, we want to use Judge.

So the first if statement should contain an 'or' instead of doing a list of
If statements. In earlier versions of MSWord (before the love affair with
drop-down boxes) i could type in chevrons and get the job done myself. Now
it is a mess.



----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...b46&dg=microsoft.public.word.mailmerge.fields
 
C

Charles Kenyon

This can be done without any fancy structure.
{IF { MERGEFIELD TITLE } = "Mr." "{ MERGEFIELD FIRSTNAME }"}{IF { MERGEFIELD
TITLE } = "Ms." "{ MERGEFIELD FIRSTNAME }"}{IF { MERGEFIELD TITLE } =
"Judge" "Judge"}

Might not be as elegant, but it gets the job done.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
M

macropod

Actually, Word DOES have an OR function, documented in the help file - look
under 'functions'. However, Word's OR function only works for two numeric
conditions. For testing multiple conditions, especially where text is
involved, try something like:
{IF{={IF{MERGEFIELD Title}= "Mr" 1 0}+{IF{MERGEFIELD Title}= "Mrs" 1
0}+{IF{MERGEFIELD Title}= "Ms" 1 0}}=1 {MERGEFIELD Name} {MERGEFIELD Title}}

For an AND test with multiple conditions, you'd replace the '+' signs with
'*'.

Cheers

ARY said:
MSWord 2003
The "If then Else" is too basic. Should include more options, like 'or' to
automate.
For example, in a familiar salutation: If a person is a Mr. or Ms., we want
to use first name. If a person is a Judge, though, we want to use Judge.

So the first if statement should contain an 'or' instead of doing a list of
If statements. In earlier versions of MSWord (before the love affair with
drop-down boxes) i could type in chevrons and get the job done myself. Now
it is a mess.



----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...b46&dg=microsoft.public.word.mailmerge.fields
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top