ACC2000: How to Import Word Print Merge Data Files into Microsoft Access (209612)



The information in this article applies to:

  • Microsoft Access 2000
  • Microsoft Word 2000

This article was previously published under Q209612
Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SUMMARY

This article describes how to import data from a Microsoft Word mail merge data file into a table in a Microsoft Access database.

MORE INFORMATION

Word can perform mail merges on a variety of data, such as data extracted from tables, or from comma- or tab-delimited fields.

To import data from a Word mail merge data file to Microsoft Access, the data must be comma- or tab-delimited, or be contained in fields of uniform length. You must also ensure that the file is saved as an unformatted text file.

If the data is in table form, the table must first be converted to a tab-delimited format before saving it as a text file.

NOTE: In Word you can create multiple-line information within a table cell that contains carriage returns (paragraph marks). The carriage returns must be removed before converting the table to a tab-delimited format.

Removing Unwanted Carriage Returns from a Table-Formatted Data File

  1. Start Microsoft Word and open the data source document.
  2. On the Edit menu, click Replace.
  3. In the Find What box, type ^p (the caret symbol (^) is generated by pressing SHIFT+6).
  4. In the Replace With box, press the SPACEBAR key once.
  5. Click Replace All.
  6. Close the Find and Replace window.
NOTE: Depending on the type of data, you may choose to use characters other than a space to replace carriage returns within a table.

Converting Data from a Table to a Tab-Delimited Format

  1. Start Microsoft Word and open the data source document.
  2. Position the insertion point anywhere inside the table.
  3. On the Table menu, point to Select, and then click Table.
  4. On the Table menu, point to Convert, and then click Table To Text.
  5. Click the Tabs button in the Convert Table to Text dialog box, and then click OK.

Saving the Data File As an Unformatted Text-Only File

  1. On the File menu, click Save As, and then type a unique file name in the File Name box.
  2. In the Save as type box in the lower-left corner, select Text Only, and then click Save.

Importing the Text Data File into Microsoft Access

  1. Start Microsoft Access, and then open the database to which you want to import the data.
  2. On the File menu, point to Get External Data, and then click Import.
  3. In the Files of Type box, select Text Files.
  4. Select the comma- or tab-delimited text data file to import, and then click Import.
  5. Select the Delimited option in the Import Text Wizard, and then click Next.
  6. Select Tab for the delimiter, and then click to select the First Row Contains Field Names check box if the first row in the Word data file contains a list of field names.
  7. Select {none} in the Text Qualifier box, and then click Finish to complete the import.
Notice that Microsoft Access has created a new table with the imported data.

REFERENCES

For more information about creating a mail merge data source, click Microsoft Word Help on the Help menu, type merge data from a table or query by using the microsoft word mail merge wizard in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

For more information about importing data to a Microsoft Access database, click Microsoft Access Help on the Help menu, type import data in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Modification Type:MajorLast Reviewed:6/24/2004
Keywords:kbhowto kbinterop KB209612