Microsoft KB Archive/294688

= How to design and set up a mail merge address list in Word =

Article ID: 294688

Article Last Modified on 4/4/2007

-

APPLIES TO


 * Microsoft Office Word 2007
 * Microsoft Office Word 2003
 * Microsoft Word 2002 Standard Edition

-



This article was previously published under Q294688



For a Microsoft Word 2000 version of this article, see 212322.



SUMMARY
This article describes the acceptable formats for a mail-merge address list and includes suggestions and questions that are helpful to ask yourself as you create an address list.

Designing a data source
In Microsoft Word, you can create a new address list within the Mail Merge Wizard. When you choose &quot;Step 3: Select Recipients&quot; in the wizard, the Type a New List option is available. This option builds your address list.

Another way to create an address list is from a Word table. You can also use any database-like format, such as a text file in which fields are separated by commas or tabs, and records are separated by paragraph marks.

In an address list, each category of information, such as last name, is called a field. The set of fields that make up information about one person is called a record.

What to consider when you design a data source
Before you create an address list, decide what information you want to include and how you want to use that information, and then design the database. This saves you time and work later.

Do some records have more information than others?
Some of your data records may have more information than other records. For example, some entries may have a business name, a department title, and up to three lines for the address. Other entries may have only a name, a one-line street address, and a third line with the city, state, and postal code.

In the address list, each data record must have the same number of data fields. Design your address list so that it has enough data fields to correspond to the record with the most fields. You do not need to fill in every field in the data record; you can leave some fields blank. Word automatically suppresses blank records.

Do you plan to sort the data?
If you plan to sort your data, you must arrange it so that you can sort the data based on some criteria. For example, the city, state, and postal code are usually printed on the same line of a mailing label, so you might want to include all of this information in the same field. If you include all of this information in the same field, you cannot sort your records based on the state or the postal code. In this case, you should separate each piece of information into a separate field.

The same is true if you want to sort your data by the last names of the addressees. In this case, you must separate the last names and the first names into separate fields.

Will you use the information in a particular field in different ways?
In a form letter, the first line of the inside address usually contains a courtesy title and the addressee's complete name. The salutation may contain only the courtesy title and last name or only the first name. If you place the title, first name, and last name in separate fields, you can use the same field to print the last name in both the address and the salutation. Alternatively, you can use one field for the complete title and name in the inside address, and a second field for the title and last name in the salutation.

Will you use the address list for several merge documents?
You can merge a single address list with any type and number of main documents. In setting up an address list to print form letters, plan the addressee information so that you can use the same data source to print the addresses on mailing labels or envelopes.

How many fields (pieces of information) do you have for each record (the collection of the pieces of information)?
If you have a few pieces of information for each record, you can use the Mail Merge Wizard (on the Tools menu) in Word. This allows you to access the Mail Merge Recipients dialog box to set up your address list.

There is a limitation of 255 fields in the Mail Merge Recipients dialog box. If your number of fields exceeds this value, do not use the Mail Merge Helper. Instead, use one of the following:
 * Use Microsoft Excel as your data source. The maximum number of data fields in an Excel worksheet is 256.
 * Use a Microsoft Access database as your data source.
 * Use a tab-delimited text file or a comma-delimited text file as your data source.

Mail-merge performance degrades as the number of fields in the header row increases. The configuration of your computer and the available memory may also limit the number of fields that you can insert in your data document.

The header record (row) cannot contain any spaces. Each header field is limited to 40 characters and must start with a letter. Each subsequent character must be a letter, a number, or the underscore character. All header fields must be filled in. Notice that the restrictions described here are different on some language Word versions.

Organizing data in tables or paragraphs
When you organize your data in a table, the table should contain a column for each field name that you want to use. The first row of the table is your header row; each subsequent row contains the information for one data record.

Although text might wrap in each cell, it will be printed correctly. The following is a list of items to consider when you use an existing address list as a data source:
 * Unless you use a separate header source, make sure that the header record is the first record (row of cells) in the address list. Make sure that there are no spaces, text, or blank lines before the header record. The header record cannot contain any spaces. Each header field is limited to 40 characters and must start with a letter. Each subsequent character must be a letter, a number, or the underscore character. All header fields must be filled in.
 * Make sure that the number of data fields in each data record equals the number of field names in the header record. If a record does not have information for a certain field, leave the cell for that field blank.
 * Arrange the information in the data records in the same order, left to right, as the corresponding field names in the header record. The order of your columns in the address list is not important, because you will control the placement of your data in the mail-merge main document.

Designing an address list that contains many fields
The Mail Merge Recipient dialog box creates an address list (.mdb) for the data file. In Microsoft Word, the maximum number of fields for the Mail Merge Recipient dialog box is 255.To create a new database from the Mail Merge Recipient dialog box, follow these steps:
 * 1) Microsoft Word 2002

On the Tools menu, click Letters and Mailings, and then click Mail Merge Wizard.

Microsoft Office Word 2003

On the Tools menu, click Letters and Mailings, and then click Mail Merge.

Microsoft Office Word 2007

On the Mailings tab, click Start Mail Merge, and then click Step by Step Mail Merge Wizard.

Follow the steps in the Mail Merge Wizard to &quot;Step 3: Select Recipients.&quot; This is where you set up your address list.
 * 1) Click Type a new list.
 * 2) Click Create. The New Address List dialog box appears. In this dialog box, type the address information for each record. If there is no information for a particular field, leave the box blank. By default, Word skips blank fields, so the merge is not affected if blank entries are in the data form. The set of information in each form makes up one data record.
 * 3) After you type the information for a record, click New Entry to move to the next record. To delete a record, click Delete Entry. To search for a specific record, click Find Entry. To filter or sort your records, click Filter and Sort.

Note If you want to customize your address list, click Customize. In the Customize Address List dialog box, you can add, delete, rename, and reorder the merge fields.
 * 1) In the New Address List dialog box, click Close.
 * 2) In the Save Address List dialog box, in the File name box, type the name that you want to give your data source, and then click Save.
 * 3) In the Mail Merge Recipients dialog box, make any changes that you want, and then click OK.

You have now created a new address and are ready to move to the next step in the Mail Merge Wizard. This step is to write your letter.

For more information about how to create a form letter, click the following article number to view the article in the Microsoft Knowledge Base:

294683 How to use mail merge to create form letters in Word 2002 and in later versions of Word

If you need more than 255 data fields in your address list, Word cannot organize the data from the Mail Merge Recipient dialog box. Instead, you can set up your information as separate paragraphs in a Word document. The header record and each data record must end with a paragraph mark, which is the data record delimiter. Each field name in the header record and each field in the data record must be separated by a tab character or comma, which is the data field delimiter. If any of the data fields is empty, you must include a field delimiter to identify the empty field.

If you are using an address list from a database or spreadsheet program, you can export this data to an ASCII text format, separated by commas or tabs. Or, you may be able to attach the database by using ODBC, DDE, or a converter. If you export your data to an ASCII format and Word does not automatically recognize the field and record delimiters, Word prompts you to select the delimiters when you first use the address list. When you set up an address list in this format in Word, you should use a paragraph mark as the data record delimiter and a tab character or comma as the data field delimiter.

In addition to the general rules for organizing an address list, the following rules also apply to address lists that are set up as regular text:
 * Press ENTER to end each data record with a paragraph mark. Make sure that there are no extra paragraph marks between or following the data records. Word interprets any empty paragraphs (blank lines) as empty records.
 * Use the same field delimiter in both the header record and the data record. For example, you cannot use tab characters in the header record and commas in the data records. Because text in data fields may include commas, it is preferable to use tab characters.
 * If a data record does not include information for a specific data field, insert two tab characters or two commas to indicate the empty field. Do not insert a second field delimiter, if the data field is the last one in the data record.
 * Enclose the data field in quotation marks if the data field contains any one of the following characters:
 * A tab character or comma, if you are using that same character to separate the fields
 * A line break or a paragraph mark
 * A character that you specified as the list separator character in the International section of Control Panel in Microsoft Windows
 * If information in a data field contains quotation marks (&quot; &quot;), type the characters twice (&quot;&quot; &quot;&quot;). When information from the data field is merged, only one pair of quotation marks will be printed.

Deciding when to use a separate header source
In most cases, it is convenient to list the field name for each data field in the first row, or record, of the address list. However, you may want to list the field names in a separate header source for the following reasons:
 * You can use the same header row and field names to merge data from various sources without having to repeat or change the header row in each address list or change the merge field names in the main document.
 * Sometimes an address list from another program does not include a header record, or field names in the header record do not match the merge field names in your main document. If you cannot modify or add a header record in the address list (for example, because the address list is read-only) you can use a separate header source that contains the field names that you specify.

Adding the &quot;Mail Merge Open Header Source&quot; button
If you use a separate header source, you must specify both the header source and the address list before you can merge the main document with the address list.

To use a header source in a Word mail merge, you must add the Mail Merge Open Header Source button to your Mail Merge toolbar. To do this, follow the steps, as appropriate for the version of Word that you are running.

Word 2002 or Word 2003

 * 1) On the View menu, point to Toolbars, and then click Mail Merge. The Mail Merge toolbar appears.
 * 2) On the Tools menu, click Customize.
 * 3) On the Commands tab, select All Commands in the Category list.
 * 4) In the Commands list, select and drag MailMergeOpenHeaderSource to your Mail Merge toolbar.
 * 5) Click Close to close the Customize dialog box.

Word 2007
To use a header source in a Word mail merge in Word 2007, you must add the Mail Merge Open Header Source button to your Quick Access Toolbar.
 * 1) In Word, click the Microsoft Office Button.
 * 2) Click Word Options.
 * 3) Click Customization.
 * 4) In the Choose commands from dialog box, click All Commands.
 * 5) Click Mail Merge Open Header Source, and then click Add.
 * 6) Click OK.

Designing a header source
When you specify a header source, remember the following rules:
 * The number of field names in the header source must equal the number of data fields in the address list.
 * Field names in the header source must be listed in the same order as the corresponding information in the address list.
 * Use the same field delimiter (either a tab character or a comma) for both the header source and the address list.
 * If your main document already contains merge fields, use the same merge fields in your header source. If you do not do this, you must replace the merge fields in the main document to match the field names in the header source. After you specify a header source, you can edit it just as you edit the address list.

Using a header record from another address list
If you have an address list that contains a header record, you can use it as a header source. For example, if you broke up your address list into several documents, you can specify the field names in the header record of the first address list. When you merge from other address lists that do not have a header record, specify the first address list as the header source. Then specify each of the remaining address lists in turn.

Word ignores the data records from the first address list and uses only the header record.

Types of data that you can use with mail merge
You can merge virtually any type of information from a mail-merge data source, including the following:
 * Any text or numbers
 * Graphics for which you have a graphics filter installed

Note If the graphics are contained in an address list from a program other than Word, you must convert the file by using a file format converter.
 * Objects created in programs that support object linking and embedding (OLE), such as Equation Editor
 * Word fields that display a result, such as an {=} (Formula) field

To add information other than text or numbers to an address list that you created in Word, you must display the address list in a document window using the Open command on the File menu. Or, open the address list in the original program that created the document. Then insert the information in the appropriate column and row of the address list table.

Types of data that you cannot use
You cannot merge text or graphics that are contained in a frame in the address list. However, you can position merge fields inside frames. When you merge the documents, the text and graphics from the address list are positioned in the frame.

Additional query words: OfficeKBHowTo inf data source mailmerge WD2003 WD2007

Keywords: kbfaq kbhowtomaster kbmerge KB294688

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.