Please Note: This article is written for users of the following Microsoft Word versions: 2007 and 2010. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Formatted Merging.

Formatted Merging

Written by Allen Wyatt (last updated November 26, 2018)
This tip applies to Word 2007 and 2010


1

When you use Word's merge tool, the information merged into a main document assumes the formatting applied in that main document. The formatting of information in the data source has no effect. Most of the time this is a desirable thing; the information in the data source could have some bizarre formatting that you don't want applied in your main document.

There are times, however, when this may not be desirable. For instance, say one of the merge fields is a company name, and you want some of the companies to be shown in bold in your main document, and other companies to be shown in regular text. Even if you make some of the companies bold in the data source, Word ignores the formatting when it does the merge with your main document.

Unfortunately, Word doesn't provide a magic switch that you can use with the company merge field to force the formatting in the data source to be used. This can be worked around with a little ingenuity and the use of Word's conditional IF field. Follow these steps to achieve the desired results:

  1. In your data source file, add another field called "FormatBold." You can actually name it anything you like; the purpose of the field is to indicate which companies should be formatted as bold when merged into the main document.
  2. For each company's record where you want the company name in bold, enter a "Y" or "yes" (be consistent) in the FormatBold field.
  3. Open the main document.
  4. At the point where you want the company name to appear in the document, insert a pair of field braces by pressing Ctrl+F9.
  5. Type IF followed by a space.
  6. Insert the new merge field you added to the data source (FormatBold).
  7. Type a space, followed by the equal sign (=) followed by "yes" or "Y" (in quotes), followed by another space. (Make sure you use the same "yes" or "Y" convention you used in step 2.)
  8. Turn on bold formatting (press Ctrl+B).
  9. Insert the company merge field followed by a space.
  10. Turn off bold formatting (again press Ctrl+B), and insert the company merge field again.

At this point, the entire compound merge field should look like the following. (If you can't see all the merge fields for some reason, select the text and press Alt+F9.)

{ IF { MERGEFIELD FormatBold } = "yes" { MERGEFIELD Company } { MERGEFIELD Company } }

Of course, the first occurrence of { MERGEFIELD Company } will be bold, and the second will not. What this field does is to check the contents of the FormatBold merge field. If it is set to "yes" then Word inserts the first Company MERGEFIELD (the bold one), otherwise the second (nonbold one) is inserted. Either way, some of your merge documents will have the company name bold, and others will not.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11278) applies to Microsoft Word 2007 and 2010. You can find a version of this tip for the older menu interface of Word here: Formatted Merging.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Selecting Default Paragraph Formatting

Want to return a paragraph's formatting back to its pristine, unaltered state? You can do so by using the shortcut ...

Discover More

Viewing Comments

Adding comments to a document is a normal activity when writing and editing. Once comments have been added, you may ...

Discover More

Error Creating Event Handlers

If you are getting an error when you try to create an event handler, it could be related to a long-known bug in Excel. ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Merging and Printing

When you merge information into a document, Word provides two different ways you can create your output. Here's an ...

Discover More

Can't Merge Alphanumeric Data Correctly

When you merge data from Excel into a Word document, you may need to do some conditional processing based on the data you ...

Discover More

Controlling Date Formats in a Mail Merge

One of the data sources that Word allows you to use for your mail merges is an Excel worksheet. You may get unexpected ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

2014-04-07 14:06:22

Nshuti

I still need details on how to KEEP the Conditional Formatting from the Excel Data source.Eg.Underligne cell B5 if its value is below X.
Tha fomatting shows in print preview, but disappear after MAIL MERGE.
Any assistance will be highly appreciated. Nshuti


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.