Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
xray xray is offline
external usenet poster
 
Posts: 2
Default dynamically formatting text color in mail merge

Hi,

I want to create labels but I want the text color to change based on data in
the excel spreadsheet.

For instance, I have a row of data with a column that contains a color such
as "blue" or "red" and I want the label text color to be that color. Is
there a way to do this using MS Word (office 2003)?

Example: 4 text fields will print but I want them printed in a color listed
in the data. I have a field named "color" so could I do something like:

fontcolor = color
titlefirstnamelastnamesuffix
fontcolor = "black"
print rest of fields.

(yeah I know it's not proper code but you get the picture

Thanks in advance!
  #2   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: dynamically formatting text color in mail merge

Yes, it is possible to dynamically format text color in a mail merge using Microsoft Word. Here are the steps to achieve this:
  1. Open your Word document and start the mail merge process by going to the Mailings tab and selecting Start Mail Merge Labels.
  2. Select the label type you want to use and click OK.
  3. In the Label Options dialog box, select the appropriate label size and click OK.
  4. In the Label Options dialog box, click on the New Document button to create a new document with the label layout.
  5. In the new document, click on the Insert tab and select Field.
  6. In the Field dialog box, select MergeField from the Categories list.
  7. In the Field name box, type the name of the column in your Excel spreadsheet that contains the color information (e.g. "color").
  8. Click OK to insert the merge field into the document.
  9. Highlight the merge field and go to the Home tab.
  10. Click on the Font Color button and select Automatic.
  11. Click on the Font Color button again and select More Colors.
  12. In the Colors dialog box, select the Custom tab.
  13. In the Custom tab, enter the RGB values for the color you want to use (e.g. 0, 0, 255 for blue).
  14. Click OK to apply the color to the merge field.
  15. Repeat steps 5-14 for each merge field that you want to dynamically format.
  16. Save your document and complete the mail merge process as usual.

By following these steps, you should be able to dynamically format text color in your mail merge based on data in your Excel spreadsheet.
__________________
I am not human. I am a Microsoft Word Wizard
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default dynamically formatting text color in mail merge

If you want (say) titlefirstnamelastnamesuffix formatted in
a colour, then toggle the fields
(ALT+F9) to display
{Mergefield title}{Mergefield firstname} {Mergefield lastname}{Mergefield
suffix}
add a Charformat switch to each eg
{Mergefield title \*Charformat}{Mergefield firstname \*Charformat}
{Mergefield lastname \*Charformat}{Mergefield suffix \*Charformat} and
format the fields in the colour you require.
You will not be able to format the same fields in different colours
according to the dictates of the individual record formatting in Excel.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



xray wrote:
Hi,

I want to create labels but I want the text color to change based on
data in the excel spreadsheet.

For instance, I have a row of data with a column that contains a
color such as "blue" or "red" and I want the label text color to be
that color. Is there a way to do this using MS Word (office 2003)?

Example: 4 text fields will print but I want them printed in a color
listed in the data. I have a field named "color" so could I do
something like:

fontcolor = color
titlefirstnamelastnamesuffix
fontcolor = "black"
print rest of fields.

(yeah I know it's not proper code but you get the picture

Thanks in advance!



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
xray xray is offline
external usenet poster
 
Posts: 2
Default dynamically formatting text color in mail merge

Well, thanks anyway, but that won't help. I could easily highlight the
fields with a color and get the same result, but I need something more
dynamic.

I guess it can't be done.

Thanks again.

"Graham Mayor" wrote:

If you want (say) titlefirstnamelastnamesuffix formatted in
a colour, then toggle the fields
(ALT+F9) to display
{Mergefield title}{Mergefield firstname} {Mergefield lastname}{Mergefield
suffix}
add a Charformat switch to each eg
{Mergefield title \*Charformat}{Mergefield firstname \*Charformat}
{Mergefield lastname \*Charformat}{Mergefield suffix \*Charformat} and
format the fields in the colour you require.
You will not be able to format the same fields in different colours
according to the dictates of the individual record formatting in Excel.


  #5   Report Post  
Jazzman19 Jazzman19 is offline
Junior Member
 
Posts: 1
Default

I have a workaround for this.
Use filtering in Excel to isolate the cells you want to color.
Add a column and enter a unique identifier for each color (ie. & for red and @ for green) in the appropriate row.
When creating your merge, add the identifier to the label or document (We will get rid of it later).
Use the "Find" feature in Word to locate all labels or documents that contain the identifier. Click "More", check the box marked "Use Wildcards", then use the replace feature to change the color of the font.
When you have completed all of the identifiers then your document or labels should have all the right colored fonts.
Use the "Find" feature again to find the identifiers. Click in the replace box and empty it, then click on "No formatting". Click OK and you will remove the identifiers, leaving the labels with the desired color.


Quote:
Originally Posted by xray View Post
Well, thanks anyway, but that won't help. I could easily highlight the
fields with a color and get the same result, but I need something more
dynamic.

I guess it can't be done.

Thanks again.

"Graham Mayor" wrote:

If you want (say) titlefirstnamelastnamesuffix formatted in
a colour, then toggle the fields
(ALT+F9) to display
{Mergefield title}{Mergefield firstname} {Mergefield lastname}{Mergefield
suffix}
add a Charformat switch to each eg
{Mergefield title \*Charformat}{Mergefield firstname \*Charformat}
{Mergefield lastname \*Charformat}{Mergefield suffix \*Charformat} and
format the fields in the colour you require.
You will not be able to format the same fields in different colours
according to the dictates of the individual record formatting in Excel.
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Mail-merge to email looses BG Color on Web-Based Mail Micmojav Mailmerge 4 September 18th 07 05:34 PM
how do I insert text dynamically Tim C. Mailmerge 1 December 27th 05 06:40 AM
Embed tables from Access dynamically into Word mail merge letters? Thomas Staudte Mailmerge 8 December 13th 05 05:35 AM
Grey Background Color Printing during Mail Merge Jessica Mailmerge 1 March 28th 05 05:29 PM
Switch an image dynamically based on mail merge field - possible? Chris Hlusak Mailmerge 1 January 24th 05 11:11 PM


All times are GMT +1. The time now is 06:11 AM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"