Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
If then Else mail merge field
HI
Is there a way to evaluate 3 condition with the if then else field option. I would like Field 4 to look at fields 1-3 and give me the value of the field the has a Yes. In the example below the vlaue of Field3 would be populated in Field 4 Field1 No Field2 No Field3 Yes Thanks for any help |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
If then Else mail merge field
Your requirement is a bit ambiguous because if you want the value of the
field that has value "Yes", the value is always going to be "yes". If ou actually want to put the /name/ of the field whose value is "Yes" into a variable you can work with, then you could use something like { IF "{ MERGEFIELD Field1 }" = "Yes" "{ SET myField4 "Field1" }" "" }{ IF "{ MERGEFIELD Field2 }" = "Yes" "{ SET myField4 "Field2" }" "" }{ IF "{ MERGEFIELD Field3 }" = "Yes" "{ SET myField4 "Field3" }" "" } If more than one of Field1, Field2, Field3 has the value "Yes" then the above code would set myField4 to the field with the highest number (e.g. if all are "Yes", myField4 would be set to "Field3" You could reference myField4 using { REF myField4 } This assumes that a. your Field1,Field2, Field3 are merge fields b. the "Yes" value is always precisely "Yes" - if it could be "YES" etc. then you would be better off with { IF "{ MERGEFIELD Field1 \*Upper }" = "YES" "{ SET myField4 "Field1" }" "" } or some such But that result does not look particularly useful to me either - maybe you want to set myfield4 to some other value depending on which of Field1, Field2, Field3 is "yes" ? If so, perhaps you can spell it out. Peter Jamieson http://tips.pjmsn.me.uk ram wrote: HI Is there a way to evaluate 3 condition with the if then else field option. I would like Field 4 to look at fields 1-3 and give me the value of the field the has a Yes. In the example below the vlaue of Field3 would be populated in Field 4 Field1 No Field2 No Field3 Yes Thanks for any help |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
If then Else mail merge field
Thank You this was very helpful
"Peter Jamieson" wrote: Your requirement is a bit ambiguous because if you want the value of the field that has value "Yes", the value is always going to be "yes". If ou actually want to put the /name/ of the field whose value is "Yes" into a variable you can work with, then you could use something like { IF "{ MERGEFIELD Field1 }" = "Yes" "{ SET myField4 "Field1" }" "" }{ IF "{ MERGEFIELD Field2 }" = "Yes" "{ SET myField4 "Field2" }" "" }{ IF "{ MERGEFIELD Field3 }" = "Yes" "{ SET myField4 "Field3" }" "" } If more than one of Field1, Field2, Field3 has the value "Yes" then the above code would set myField4 to the field with the highest number (e.g. if all are "Yes", myField4 would be set to "Field3" You could reference myField4 using { REF myField4 } This assumes that a. your Field1,Field2, Field3 are merge fields b. the "Yes" value is always precisely "Yes" - if it could be "YES" etc. then you would be better off with { IF "{ MERGEFIELD Field1 \*Upper }" = "YES" "{ SET myField4 "Field1" }" "" } or some such But that result does not look particularly useful to me either - maybe you want to set myfield4 to some other value depending on which of Field1, Field2, Field3 is "yes" ? If so, perhaps you can spell it out. Peter Jamieson http://tips.pjmsn.me.uk ram wrote: HI Is there a way to evaluate 3 condition with the if then else field option. I would like Field 4 to look at fields 1-3 and give me the value of the field the has a Yes. In the example below the vlaue of Field3 would be populated in Field 4 Field1 No Field2 No Field3 Yes Thanks for any help |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can you limit the text in a merge field for mail merge documents? | Mailmerge | |||
Mail merge using calculation field in an IF field | Mailmerge | |||
Insert Merge Field problem with Word-Mail Merge from Excel documen | Microsoft Word Help | |||
Mail merge field different in datasource & insert a field menu | Mailmerge | |||
Mail merge field isn't displaying all the text in a field. Can I . | Mailmerge |