Answer Box: Text formatting vanishes during a mail merge in Word

Answer Box

By Connie Miller

Can text formatting vanish? The answer is yes, if you format the text in a data file and then merge it into a publication. Learn what causes this disappearing act and find out how to format text in merged publications so the formatting sticks.

Applies to
Microsoft Office Word 2003
Microsoft Word 2002

A question from your comments

I knew how I wanted the text in my merged documents to look, so I spent some time applying fonts and colors to the text in my data file. Then I did a mail merge, and the text in the merged documents was just plain old black Arial text. What happened to my formatting, and how can I fix it?

Advice from the Answer Box

What happened was, unfortunately, what was supposed to happen. Database and spreadsheet programs, such as Microsoft Office Access and Microsoft Office Excel, store as raw data the information that you type in cells. Formatting that you apply, such as fonts and colors, isn't stored with the raw data. Instead, the program reapplies the formatting each time you open a database or spreadsheet file. When you merge information from a data file into a Word document, you're merging the raw data without the applied formatting.

There's no way to get back the time you spent applying the formatting in your data file. On the brighter side, though, you definitely can format text to look just the way you want in your merged documents, and it won't take you long.

I'll cover two approaches to formatting text in merged documents and give you some advice about which approach to use when:

Approach Advice
Format fields in the main document
  • Very easy and straightforward, because you just do stuff you're already accustomed to doing
Add a neat little formatting switch to field codes
  • A great way to learn a little more about how field codes work in mail merge

Format fields in the main document

Let's say you're creating form letters for a mass mailing. You want the prices that will appear in the letters to be bold and colored blue so that they stand out. What do you do?

You've already learned from bitter experience that applying the formatting to prices in the Price column of your data file doesn't get you where you want to be. But you certainly don't have to format the price individually in each of the 2,000 or however many letters you intend to mail.

There is a comfortable, quick solution to this problem right in the middle: You apply formatting to fields in your main document.

Just a refresher here — in case you've had other things on your mind and have forgotten some of your mail-merge vocabulary. In a mail merge, you start with the main document. This starting document contains the information that will be the same in each copy of the merged document. It also includes placeholders (called fields) for the information that will be unique in each copy.

Fields inserted into a Word document

Fields, which act as placeholders for unique information, are surrounded by chevrons (« ») in the main document.

For example, in the form letter with the bold, blue prices, the body of the letter will always be the same — but the address, greeting, and price will be unique in each copy.

In the main document, you type the body text, and then you add fields for address, greeting, and price. The sentence that includes the Price field looks something like this, where «Price» is the field:

"The item you special-ordered will cost «Price». Please send full payment as soon as possible."

To get the price to show up bold and blue in each merged copy of the letter, all you have to do is select that field and format it, just as you would format any text. Make sure that the formatting extends to include the chevrons (« ») that surround the field.

In the main document, the formatted field looks something like this:

"The item you special-ordered will cost Bold, blue price field. Please send full payment as soon as possible."

After you format all the fields in the main document just the way you want, you're ready to preview the merged documents and forge ahead with the merge.

Add a neat little switch to field codes

You can accomplish exactly the same thing by working with the field codes behind the fields instead of with the fields themselves. To see the codes behind the fields in your main document, press ALT+F9. When field codes are displayed, the sentence that contains the Price field looks something like this, where { MERGEFIELD "Price" } is the field code for the Price field:

"The item you special-ordered will cost { MERGEFIELD "Price" }. Please send full payment as soon as possible."

To format the Price field, take two steps:

  1. Format the first letter in the field code (only that one letter — nothing more) exactly the way you want the text to look in the merged documents. In this case, you apply bold, blue formatting only to the M.
  2. Type the Charformat switch (\*Charformat) inside the braces.

After you take these steps, this is how the field code looks:

Field code with Charformat switch

  • The backslash starts the switch.
  • The asterisk defines the switch as a character formatting switch.
  • "Charformat" means that the formatting of the first letter of the field code will be applied to the entire field.

Extra information    There are lots of different types of fields in Word. A MERGEFIELD field, such as the «Price» field, is a placeholder in a mail-merge main document for information from a data file.

When you've finished adding the switch to the field code, press ALT+F9 again to hide the field codes and view the placeholders. Don't expect the formatting you just applied by using the switch to immediately show up in the «Price» field. To see the formatting, preview the merged documents.

 Note    If you followed the instructions above and formatted the first letter of the field code, typed the Charformat switch, and previewed the merged documents, but the field still isn't formatted, try this: In the field code, select and apply formatting to the space before the first letter as well as to the first letter itself. Do everything else just the same. When you preview, the field should now be formatted.

In the See Also box, you will find a link to more information about using character formatting switches.

Wishing you many happy merges,

Connie, the Answer Box monitor

About the Author

Connie Miller, a writer on the Microsoft Office User Assistance team, collects and responds to questions and suggestions you submit to the Word Answer Box. To submit a question or suggestion, click Feedback.

Applies to:
Word 2003