Link to home
Start Free TrialLog in
Avatar of theabbeyschool
theabbeyschoolFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Can you mail merge in Word and bring the font colour from the data set through ?

Hi,

I am actually trying to do this in Publisher but I'm sure if it is possible in Word, it will work in Publisher too.

I have a set of data in Excel. One of the columns contains text that is formatted to different colours depending on the data e.g. if the data is 'A' then the font used is green. 'B' would be orange, etc.

Is it possible to mail merge this data with a Word document and bring the font colour from Excel through into Word so that when the actual data is displayed, it is displayed in the same colour in Word as it is in Excel?

Many thanks
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

No. The recordset that Word is using does not contain any formatting information. You would have to automate the Excel application, open the workbook and copy the data.
If you couls arrange an extra column os the worksheet to have text that depends on the colour of the cell, then you could use IF fields to test the text and then display the field in the appropriate colour.

Here Field a  has the data that you wish to colour and Field b has the differentiating text. I have used the words "Red, "Green" and "Black"

There may be a way of using Excel formulae to fill the colour-indicating column. Rory would know. I am sure that it is possible in VBA

a          b
Tom     Green
Dick     Black
Harry   Red  

Here is a picture of the IF and the MERGEFIELDs in the Word document. (Use Alt + F9 to toggle the field display in the Word document)
Clip0002.jpg
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial