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 / November 2006

Tip: Looking for answers? Try searching our database.

Revise a mailmerge main letter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TomC - 25 Nov 2006 17:17 GMT
I have a main letter in mailmerge which I needed to modify by adding a
multiple "IF AND" condition.  I'm sure there must be a better way than the
way I did it.  I used the Insert Word Field and finally got it modified to
state {IF {= AND ( {COMPARE { MERGEFIELD etc.  Is there some way I could just
key in this "AND" function without using the "Insert Word Field"?  Thanks.
Doug Robbins - Word MVP - 25 Nov 2006 19:20 GMT
You can use Ctrl+F9 to insert the necessary field delimiters { } and then
type in the expression that you want to use.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> I have a main letter in mailmerge which I needed to modify by adding a
> multiple "IF AND" condition.  I'm sure there must be a better way than the
> way I did it.  I used the Insert Word Field and finally got it modified to
> state {IF {= AND ( {COMPARE { MERGEFIELD etc.  Is there some way I could
> just
> key in this "AND" function without using the "Insert Word Field"?  Thanks.
macropod - 27 Nov 2006 11:11 GMT
Hi Tom,

You almost certainly don't need the COMPARE expression. Plus, Word's AND
expression is limited to combining two statements. An alternative construct,
which avoids both the COMPARE expression and the AND expression, is:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}*{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}= 1 “Both conditions met” “At least one condition not met”}
Here, the '*' performs the same function as an AND expression. You can
simply keep adding more statements, thus:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}*{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}*{IF{MERGEFIELD Field_Three}= "Cond3" 1 0}= 1 “All conditions
met” “At least one condition not met”}

A slight variation on this allows you to create the equivalent of an OR
expression:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}+{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}> 0 “At least one condition met” “No conditions met”}
and:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}+{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}+{IF{MERGEFIELD Field_Three}= "Cond3" 1 0}> 0 “At least one
condition met” “No conditions met”}
or even:
{IF{IF{MERGEFIELD Field_One}= "Cond1" 1 0}+{IF{MERGEFIELD Field_Two}=
"Cond2" 1 0}+{IF{MERGEFIELD Field_Three}= "Cond3" 1 0}> 1 “At two conditions
met” “At least two conditions not met”}
Here, the '+' performs the same function as an OR expression. Plus, as you
can see from the last example, it allows you to do much more than a simple
OR expression ever could.

Cheers

Signature

macropod
[MVP - Microsoft Word]

> I have a main letter in mailmerge which I needed to modify by adding a
> multiple "IF AND" condition.  I'm sure there must be a better way than the
> way I did it.  I used the Insert Word Field and finally got it modified to
> state {IF {= AND ( {COMPARE { MERGEFIELD etc.  Is there some way I could just
> key in this "AND" function without using the "Insert Word Field"?  Thanks.
 
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.