Microsoft Word - Word 2010 text if then conditional formatting

Asked By D on 22-Jun-12 05:45 PM
Earn up to 20 extra points for answering this tough question.
I have a Word 2010 mail merge template and I want to be able to set a field text color to blue if another field text = yes.

e.g.,  Bereaved Parent field = yes then whatever text is in the Shirt field will be blue
Vikram Singh Saini replied to D on 24-Jun-12 08:15 PM
Hi,

I have framed solution for your requirement and tested it. Follow steps: (Field values modified in demo apps but it would work)

(1) I have put two fields during mail merge wizard steps. Fields used are State and City.  You can replace them with Bereaved Parent field and Shirt field respectively. (I hope you are aware of adding fields to the mail merge template)

(2) I have put condition for checking if State is Rajasthan, then the City field should be visible with blue color else Other. Here is the condition logic (visible in Template by using Alt-F9):

How are you? Living in { MERGEFIELD State }? I think you are living in City { IF {MERGEFIELD State } = "Rajasthan" "{ MERGEFIELD City }" "Other" }

The same above query in your case would be as:

{ IF {MERGEFIELD BereavedParentField } = "yes" "{ MERGEFIELD ShirtField }" "Other" }

Note: Point to be noticed:- As you can see in conditional logic we have made the fields City and ShirtField blue in color including quotation. Yes! That would make the text appears blue while using conditions. And that's the solution.

Precaution: The value such as "yes" or "Rajasthan", which is used to compare with field values should be exactly same in case-wise too. Else it will not work as expected.

(3) Save the template and test it. Finally let us know if it helped or not and if left any doubts.