Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word "If-then-else" Field
Hi,
I'm trying to create a mail merge document that will display information for a particular academic area based on three criteria that are in the data source. One is degree (ADEG1), one is College (ACOL1) and one is Major Code (MAJ1_CODE). I have been trying to nest the IF statements to look at all three fields, but I can only get it to the point where it will look at two of the fields. If anyone has made an IF work with more than two fields, would you let me know? The code that works is below. Where I'm getting stuck is adding in the third field. No matter what I've tried, it throws a field calculation error when I try to run the merge. I'd really appreciate any help you might be able to provide. { IF { = AND ( { COMPARE {MERGEFIELD ACOL1="Graduate School of Management" }, {COMPARE {MERGEFIELD AMAJ1_CODE } = "BU-MBA" } ) } = 1 "Contact Name" "" } If you know of a different way to nest IF statements and can provide an example, that would be fantastic. I've tried looking on line and in MS Online help, but this is the best I can locate. Thanks so much, -- Michelle Craig Kent State University |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word "If-then-else" Field
I think you need: { IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management" "{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA" "Contact Name" "" } "" } You can probably ditch the "" around the { MERGEFIELD } fields. Peter Jamieson "Michelle Craig" wrote in message ... Hi, I'm trying to create a mail merge document that will display information for a particular academic area based on three criteria that are in the data source. One is degree (ADEG1), one is College (ACOL1) and one is Major Code (MAJ1_CODE). I have been trying to nest the IF statements to look at all three fields, but I can only get it to the point where it will look at two of the fields. If anyone has made an IF work with more than two fields, would you let me know? The code that works is below. Where I'm getting stuck is adding in the third field. No matter what I've tried, it throws a field calculation error when I try to run the merge. I'd really appreciate any help you might be able to provide. { IF { = AND ( { COMPARE {MERGEFIELD ACOL1="Graduate School of Management" }, {COMPARE {MERGEFIELD AMAJ1_CODE } = "BU-MBA" } ) } = 1 "Contact Name" "" } If you know of a different way to nest IF statements and can provide an example, that would be fantastic. I've tried looking on line and in MS Online help, but this is the best I can locate. Thanks so much, -- Michelle Craig Kent State University |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word "If-then-else" Field
Peter,
Thanks so much for pointing me in the right direction. I was able to get it to work with three nested IFs. It worked great. The code ended up as follows: { IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management" "{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA" "{IF "{MERGEFIELD ADEG1}" = "MBA" "Contact Name" } "" } "" } -- Michelle Craig Kent State University "Peter Jamieson" wrote: I think you need: { IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management" "{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA" "Contact Name" "" } "" } You can probably ditch the "" around the { MERGEFIELD } fields. Peter Jamieson "Michelle Craig" wrote in message ... Hi, I'm trying to create a mail merge document that will display information for a particular academic area based on three criteria that are in the data source. One is degree (ADEG1), one is College (ACOL1) and one is Major Code (MAJ1_CODE). I have been trying to nest the IF statements to look at all three fields, but I can only get it to the point where it will look at two of the fields. If anyone has made an IF work with more than two fields, would you let me know? The code that works is below. Where I'm getting stuck is adding in the third field. No matter what I've tried, it throws a field calculation error when I try to run the merge. I'd really appreciate any help you might be able to provide. { IF { = AND ( { COMPARE {MERGEFIELD ACOL1="Graduate School of Management" }, {COMPARE {MERGEFIELD AMAJ1_CODE } = "BU-MBA" } ) } = 1 "Contact Name" "" } If you know of a different way to nest IF statements and can provide an example, that would be fantastic. I've tried looking on line and in MS Online help, but this is the best I can locate. Thanks so much, -- Michelle Craig Kent State University |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What does "char" "char1" "char2" mean in styles in Word? | Microsoft Word Help | |||
"Print current page" should have a "+n pages" field. | Microsoft Word Help | |||
"h" and "t" allowed in form Number field | Microsoft Word Help | |||
New field for Word: {SCREENTIP "DisplayText" "TipText"} | Microsoft Word Help | |||
In a Fillin Field, how do I get "th" or "rd" to be in superscript? | Microsoft Word Help |