Microsoft KB Archive/103629

From BetaArchive Wiki

Article ID: 103629

Article Last Modified on 5/6/2003


  • Microsoft Access 1.0 Standard Edition
  • Microsoft Access 1.1 Standard Edition
  • Microsoft Access 2.0 Standard Edition
  • Microsoft Word 1.1 Standard Edition
  • Microsoft Word 1.1 Standard Edition
  • Microsoft Word 2.0 Standard Edition
  • Microsoft Word 2.0a
  • Microsoft Office Word 2003
  • Microsoft Word 2.0c

This article was previously published under Q103629


Advanced: Requires expert coding, interoperability, and multiuser skills.

There is no Microsoft Word for Windows file converter capable of reading Microsoft Access database files. In order to use data from a Microsoft Access database in a Microsoft Word for Windows print merge, the data must first be exported from Microsoft Access in a format that Microsoft Word for Windows recognizes.

In Microsoft Access version 1.0, you can export the data in dBASE IV format. In Microsoft Access versions 1.1 and 2.0, you can export the data in Word For Windows Merge format. We do not recommend that you export Microsoft Access data to Word for Windows using the Text (Delimited format.


Exporting Data from Microsoft Access for Use in a Print Merge

  1. Open the Microsoft Access database table that contains the data you want to use in a Microsoft Word for Windows print merge.
  2. From the File menu, choose Export. In Microsoft Access version 1.1 or 2.0, select Word For Windows Merge in the Data Destination box. In Microsoft Access version 1.0 select dBASE IV as the data destination. Choose OK.
  3. From the Table list, select the table to be exported, and choose OK.

    NOTE: Microsoft Access only shows you a list of available tables to export. If you want to export a subset of a table, you can create a query to result in the subset you want, and export the results to a print merge data file. For information on how to export the results of a query to a file, query on the following words here in the Microsoft Knowledge Base:

    access and export and query and transfer and results

  4. Enter a unique filename in the File Name box. Select the appropriate destination directory in the Directory box and then choose OK.


  • Microsoft Access 1.1 will default the export filename to the same name as your table, with a .TXT extension, and will place the file in the Microsoft Access directory. Microsoft Access 1.0 will default the export filename to the same name as your table, with a .DBF extension. In either case, you may want to change the directory to your Microsoft Word for Windows directory and give the file a .DOC extension to make it easier to find in Word for Windows.
  • In Microsoft Access versions 1.1 and 2.0, you can select custom formats in the Export Options dialog box. These options determine how dates, times, and numbers are formatted in the data file. Although you can select custom formats, you do not need to make any changes in this dialog box.
  • In Microsoft Access 2.0, you can export the data with the Output To command from the File menu. You can output the table to Rich Text format, which Word for Windows can read.

This format will maintain the table structure, if the table does not exceed Microsoft Word for Windows internal limits. This method does not correct the field names, which can cause problems with a Microsoft Word for Windows print merge. Problems with Microsoft Access field names in a Word for Windows print merge are discussed later in this article.

Using the Exported Data in Microsoft Word for Windows

  1. Open or create the main document in Microsoft Word for Windows.
  2. From the File menu, choose Print Merge.
  3. Choose Attach Data File.
  4. From the file list, select the exported file, and then choose OK.

NOTE: You may have to type "*.TXT" or "*.DBF" (without the quotation marks) in the File Name box to see text or dBASE files in the filename list.

  1. Use the Insert Merge Fields tool on the print merge toolbar to insert fields in your main document. Consult the Microsoft Word for Windows documentation for information on how to use the merge features.

Problems Exporting Data Using the Text (Delimited) Format

One method of exporting data to Microsoft Word for Windows is to use the Text (Delimited) format. However, exporting the data in this format may require some changes to the exported data file before it can be used for a print merge.

The problem is that a number of restrictions are placed on field names used in a Microsoft Word for Windows print merge, including the following:

  • Field names cannot contain spaces.
  • Field names cannot begin with a number.
  • Field names cannot be longer than 20 characters in length.
  • Field names cannot contain special characters.

Microsoft Access field names do not have these restrictions. Consequently, you can export data from Microsoft Access that contains field names incompatible with Microsoft Word for Windows. If you use the Text (Delimited) format for exporting data, you may have to change the field names in the exported data file so that they meet the restrictions listed above.

If you use the dBASE IV or Word For Windows Merge formats, Microsoft Access will perform field name conversions to ensure that the data files will work correctly with Microsoft Word for Windows.

Microsoft Access Field Name Conversion

As discussed previously, Microsoft Word for Windows places a number of restrictions on the field names used in a print merge. Since Microsoft Access is not limited by these restrictions, it must perform field name conversions when exporting data to a print merge data file.

Microsoft Access performs field name conversions using the following rules:

  • Any spaces or illegal characters are converted to underscores.
  • If the first character in a field name is a number or an underscore, Microsoft Access adds the prefix "m_". For example, 1Field becomes m_1Field, and _Field2 becomes m__Field2.
  • Microsoft Access truncates field names that are longer than 20 characters.
  • If a conversion results in a duplicate field name, Microsoft Access adds a number to the end of each duplicate name (replacing the final character, if the field name contains twenty characters). For example, the field names Order#, Order$, and Order% become Order_, Order_1, and Order_2.

Keywords: kbinfo kbinterop KB103629