ACC: Exporting Tables from Microsoft Word with AccessExporter Macro (122247)



The information in this article applies to:

  • Microsoft Access 1.0
  • Microsoft Access 1.1
  • Microsoft Access 2.0
  • Microsoft Access for Windows 95 7.0

This article was previously published under Q122247

SUMMARY

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

Microsoft Word version 6.0 for Windows contains a macro called AccessExporter that you can use to export tables from Word to Microsoft Access. The AccessExporter macro is in the TABLES.DOT template included in Word 6.0. Templates are usually installed in the /Macros subdirectory.

MORE INFORMATION

The AccessExporter macro exports the selected portion of a Word table to a Microsoft Access table. When you run the macro, you are prompted for the name of the Microsoft Access database to which you want to export the table. You can export the Word table to an existing Microsoft Access table, or you can have the macro create a new table in Microsoft Access. You can also specify whether the first row in the Word table contains the table's field names.

The following steps demonstrate how to use the AccessExporter macro to export a table from Word 6.0 to Microsoft Access:
  1. Start Word 6.0 and open the document that contains the table you want to export to Microsoft Access.
  2. On the File menu, click Templates, and then click Add.
  3. In the Directories box, select the WINWORD\MACROS subdirectory. In the File Name box, select the TABLES.DOT file. Click OK, verify that the TABLES.DOT file is listed in the Global Templates And Add-ins box, and then click OK again.
  4. Click anywhere in the table you want to export, and then click Select Table on the Table menu. (Or, use the mouse to select the portion of the table you want to export.)
  5. On the Tools menu, click Macro. In the Macro Name box, select AccessExporter, and then click Run.
  6. In the File Name box, select the Microsoft Access database to which you want to export the Word table, and then click OK.
  7. In the Export Table Options dialog box, select the appropriate options. Click Help for a description of each option. Click OK when you are ready to export the table.
The macro functions by exporting the selected portion of the Word table to a delimited text file, and then importing the text file into the Microsoft Access database. If you choose to create a new table in Microsoft Access, the table will be called Winword.

Modification Type:MajorLast Reviewed:5/6/2003
Keywords:kbinfo kbinterop KB122247