About mail-merge fields

A mail-merge field is a set of codes that instructs Word to insert text and other information into a merged document automatically. Informally, you can think of mail-merge fields as placeholders. After you add field placeholders to your main document (main document: In a mail-merge operation in Word, the document that contains the text and graphics that are the same for each version of the merged document, for example, the return address or salutation in a form letter.) and run a mail merge, data from a data file replaces the placeholders to create a set of merged documents.

How-to information     The following links to how-to information are available under See Also, which is visible when you are connected to the Internet.

  • To find out how to add a mail-merge field, click the Add fields to a form letter or other mail-merge document link.
  • If you're having a specific problem with fields (for example, numbers such as zip codes are not merging correctly), click the Answer Box link.
  • If you're interested in learning more about fields, such as If...Then...Else, that control how Word merges information, see Advanced fields.

Setting up mail-merge fields

In a mail merge, you usually use fields as placeholders for information that comes directly from a data file (the file where you store the names, addresses, and other information that you are trying to merge). Fields correspond to column headings from the data file.

Data file with columns (categories) and rows (records)

Callout 1 Columns in a data file represent categories of information. Fields that you add to the main document are placeholders for these categories.
Callout 2 Columns in a data file represent categories of information. Fields that you add to the main document are placeholders for these categories.

By putting a field in your main document (main document: In a mail-merge operation in Word, the document that contains the text and graphics that are the same for each version of the merged document, for example, the return address or salutation in a form letter.), you indicate that you want a certain category of information, such as name or address, to appear in that location.

Fields inserted into a Word document

 Note   When you insert a mail-merge field into the main document, the field name is always surrounded by chevrons (« »). These chevrons will not show up in the merged documents. They just help you distinguish the fields in the main document from regular text.

What happens when you merge

When you merge, information from the first row in the data file replaces the fields in your main document to create the first merged document. Information from the second row in the data file replaces the fields to create the second merged document, and so on.

Merging information from data file into document

Working with fields: Examples

You can add any column heading from your data file to the main document as a field. This gives you flexibility when you design form letters, labels, e-mail messages, and other merged documents. For example:

  • Suppose you are creating a letter to notify local businesses that they have been selected for inclusion in your annual city guide. If your data file contains a Company column with the name of each business that you want to contact, you can insert the «Company» field instead of typing the name of each individual company.
  • Imagine that you send quarterly e-mail messages to your customers alerting them to new products and special deals. To personalize those messages for your best customers, you might add a Personal Note column to your data file where you can type notes such as "Miss Miller, the new widget is exactly what you have been looking for." By placing a «Personal_Note» field in the main document, you can include those notes at the bottom of certain messages.
  • If you want to add a picture to each of your mailing labels, you can include a Picture column in your data file, and then type the path to the picture (for example, C:\Documents and Settings\user name\My Documents\My Pictures\PetPhoto.jpg) in each cell of the column. If you place a «Picture» field in the label main label document before you run the merge, you will see a picture on each merged label.

You can combine fields and separate them by punctuation marks. For example, to create an address, you can set up the fields in your main document like this:

«First Name» «Last Name»

«Street Address»

«City», «State» «Postal code»

For things that you use frequently, like address blocks and greeting lines, Word provides composite fields that group a number of fields together. For example:

  • The Address Block field is a combination of several fields, including first name, last name, street address, city, and postal code.

Elements in an Address block field

  • The Greeting Line field can include one or more name fields, depending on your chosen salutation.

You can customize the content in each of these composite fields. For example, in the address, you may want to select a formal name format (Mr. Joshua Randall Jr.); in the greeting, you may want to use "To" instead of "Dear."

Advanced fields: controlling how Word merges information

Some fields are designed to help you control how Word merges information. Here are a few examples:

You can also use MergeRec, MergeSeq, Next, NextIf, and SkipIf fields in a mail merge.

How-to information     To learn how to set up any of these fields, search on a field name in Word Help. To find out how to insert a field, click the Insert a field link under See Also, which is visible when you are connected to the Internet.

 Note   To see the code behind the fields in a main document, press ALT+F9. To see fields again, press ALT+F9 a second time.

 
 
Applies to:
Word 2003