Word 2010 - 邮件合并多个条件


0

我试图让邮件合并来处理某些条件,例如:如果mergefield spouse = 1且mergefield lawyer = 2且mergefield children = 3且mergefield parent = 4则添加某些文本

要么

如果mergefield spouse = 1且mergefield lawyer = 0且mergefield children = 2且mergefield parent = 0则添加此文本

等因此,取决于合并域的顺序将取决于文本添加

我尝试了以下但它似乎没有工作{IF {= OR({COMPARE {MERGEFIELD“Spouse”} =“0”},{COMPARE {MERGEFIELD“lawyer”} =“1”{COMPARE {MERGEFIELD“Children” } =“0”},{COMPARE {MERGEFIELD“Parent”} =“0”})} =“1”“律师文本”“”}

或{IF {= OR({COMPARE {MERGEFIELD“Spouse”} =“1”},{COMPARE {MERGEFIELD“lawyer”} =“3”{COMPARE {MERGEFIELD“Children”} =“2”},{COMPARE { MERGEFIELD“Parent”} =“0”})} =“1”“Family 1 Text”“”}

要么

{IF {= OR({COMPARE {MERGEFIELD“Spouse”} =“1”},{COMPARE {MERGEFIELD“lawyer”} =“0”{COMPARE {MERGEFIELD“Children”} =“2”},{COMPARE {MERGEFIELD “父母”} =“3”})} =“1”“家庭第一文字”“”}

Answers:


0

基本IF语法可以嵌套来测试多个条件。

单一条件(基本):

{IF {MERGEFIELD FIELD1} = "CONDITION1" "TRUE" "FALSE"}

两个条件:

{IF {MERGEFIELD FIELD1} = "CONDITION1" "{IF {MERGEFIELD FIELD2} = "CONDITION2" "TRUE" "FALSE2"}" "FALSE1"}

你的例子:

{IF {MERGEFIELD SPOUSE} = "1" "{IF {MERGEFIELD LAWYER} = "0" "{IF {MERGEFIELD CHILDREN} = "2" "{IF {MERGEFIELD PARENT} = "0" "add this text" ""}" ""}" ""}" ""}
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.