0
votes

--Environment: Office 2007 (Word-Excel)--

I'm performing a Mail Merge into Word from an Excel table. One of the Excel fields has a simple conditional formatting (if field1>field2 red else green). How can I cascade the conditional formatting of that field into the word document? thanks

1
what do you mean with cascade? in general, Mail Merge allows to get data from your excel file while conditional formatting is a kind of visualisation, not data.Kazimierz Jawor
oh I understand. I need then to re-apply the conditional formatting in Word. Any idea of how could this be achieved?Blopster75
I have no idea what is your goal therefore I can't suggest anything. Try to work with Word macro-recorder as a first step.Kazimierz Jawor
If you want to do it in mailmerge, you really need to ensure that you have columns in your data source that tell you what formatting you need to apply in Word, and you need to be able to interpret that data using { IF } fields that apply different formatting depending on the data - e.g. { IF "{ MERGEFIELD redgreen }" = "red" "{ MERGEFIELD myfield *Charformat }" "{ MERGEFIELD myfield *Charformat }" } and apply red formatting to the first result field and green formatting to the second. It's that, or use mailmerge events and/or use the Excel object model to retrieve the colour info.user1379931

1 Answers

0
votes

I have done this long time ago where I want FieldA to be red if FieldB is 1, otherwise FieldA is normal color.

You need to Toggle Field codes and edit it. Below will use Bold. Syntax is like:

{ IF { MERGEFIELD "Field B" } = 1 { MERGEFIELD "Field A" } { MERGEFIELD "Field A" } }

{ IF { MERGEFIELD "FieldB" } = 1 { MERGEFIELD "FieldA" } { MERGEFIELD "FieldA" } }

You need to highlight the field including {...} and change the format to desired.