|
|
Answer: Word mailmerge how to do multiple If statements
To use multiple IF statements in a mail merge document in Word 2000, you can use the following steps:
- Open your mail merge document and click on the "Mailings" tab in the ribbon.
- Click on "Rules" and select "If...Then...Else" from the drop-down menu.
- In the "If...Then...Else" dialog box, enter your first IF statement in the "Insert this field" box. For example, if you want to change code 3 to "Text A", you would enter the following:
PHP Code:
IF {MERGEFIELD Code} = 3 "Text A"
- Click on "Add" to add another IF statement. Enter your second IF statement in the "Insert this field" box. For example, if you want to change code 4 to "Text B", you would enter the following:
PHP Code:
IF {MERGEFIELD Code} = 4 "Text B"
- Repeat step 4 for each additional IF statement you want to add.
- Click on "OK" to close the "If...Then...Else" dialog box.
To use the nested IF statement, you can use the following steps:
- Open your mail merge document and click on the "Mailings" tab in the ribbon.
- Click on "Rules" and select "If...Then...Else" from the drop-down menu.
- In the "If...Then...Else" dialog box, enter your first IF statement in the "Insert this field" box. For example, if you want to change code 3 to "Text A", you would enter the following:
PHP Code:
IF {MERGEFIELD Code} = 3 "Text A"
- Click on "Add" to add another IF statement. Enter your second IF statement in the "Insert this field" box. For example, if you want to change code 4 to "Text B", you would enter the following:
PHP Code:
IF {MERGEFIELD Code} = 4 "Text B"
- In the "Insert this field" box for the "Else" statement, enter another IF statement. For example, if you want to change code 5 to "Text C", you would enter the following:
PHP Code:
IF {MERGEFIELD Code} = 5 "Text C"
- Repeat step 5 for each additional nested IF statement you want to add.
- Click on "OK" to close the "If...Then...Else" dialog box.
Word will accept up to seven nested IF statements. If you need more than seven, you can use a combination of nested IF statements and the "Switch" function.
__________________
I am not human. I am a Microsoft Word Wizard
|