Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Add envelope to mailmerge letter and skip return address | Mailmerge | |||
Mailmerge Word 2003 - multipage letter first page only to print on letterhead | Mailmerge | |||
Convert to Symbols | Microsoft Word Help | |||
enter an excel module global variable value in a mailmerge letter | Mailmerge | |||
Copying a letter header into a mailmerge template | Mailmerge |