Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
TomC TomC is offline
external usenet poster
 
Posts: 4
Default Revise a mailmerge main letter

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.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Revise a mailmerge main letter

You can use Ctrl+F9 to insert the necessary field delimiters { } and then
type in the expression that you want to use.

--
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

"TomC" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default Revise a mailmerge main letter

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

--
macropod
[MVP - Microsoft Word]


"TomC" wrote in message
...
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.



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
Add envelope to mailmerge letter and skip return address Phil Raidt Mailmerge 2 November 14th 06 01:13 PM
Mailmerge Word 2003 - multipage letter first page only to print on letterhead Sara-Jane Bunting Mailmerge 2 June 9th 06 04:39 AM
Convert to Symbols Omar Menjivar Microsoft Word Help 7 June 27th 05 07:32 PM
enter an excel module global variable value in a mailmerge letter windowed Mailmerge 1 March 22nd 05 09:31 PM
Copying a letter header into a mailmerge template dixie Mailmerge 4 December 20th 04 08:17 AM


All times are GMT +1. The time now is 11:22 PM.

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"