Microsoft KB Archive/193718

= WD95: How to Use Microsoft Access 95 Data in Word =

Article ID: 193718

Article Last Modified on 8/18/2005

-

APPLIES TO


 * Microsoft Word 95 Standard Edition
 * Microsoft Word 95a

-



This article was previously published under Q193718





SUMMARY
This article explains how to do the following:


 * How to Use a Microsoft Access Query or Table as a Word Data Source.
 * How to Use MS Query to Retrieve MS Access Data as a Data Source in Word.
 * How to Export and Use Your Data From MS Access as a Word Data Source.
 * How to Copy, Paste, and Use Microsoft Access Data as a Word Data Source.



MORE INFORMATION
Use the procedure appropriate for your situation:

How to Use a Microsoft Access Query or Table as a Word Data Source
To use a Microsoft Access query or table as a Word data source, follow these steps:

 If you want to use the results of a Microsoft Access query or table as your data source in a Word mail merge, in the Mail Merge Helper (on the Tools menu, click Mail Merge), click Get Data and then click Open Data Source.

-or-

If you want to insert the results of a Microsoft Access query or table in a Word document, in the Database dialog box (on the Insert menu, click Database), click Get Data. In the Open Data Source dialog box, follow these steps:  Change the Files of Type box to "MS Access Databases." Click to select your Microsoft Access database file. Click to select the Select Method check box. Click Open.</li></ol> </li> In the Confirm Data Source dialog box, select "MS Access Databases via DDE (*.mdb)," and then click OK.

NOTE: If "MS Access Databases via DDE (*.mdb)" is not available, you will need to remove and then reinstall Microsoft Access for Windows 95.</li> In the Microsoft Access dialog box, select the Queries tab or the Tables tab.</li> Select the query or table you want to use, and then click OK.

NOTE: On the Queries tab, the Create Link check box is selected by default. This option creates a link to the Microsoft Access database query. Select this check box to always retrieve the most up-to-date version of any of the listed queries. To ignore changes to the original query instructions, clear the Link to queries check box.</li> You will receive the results of your Microsoft Access query or table in your Word document.

If you are using mail merge, you will be prompted with the following message:

Word found no merge fields in your main document. Choose the Edit Main Document button to insert merge fields into your main document.

Click Edit Main Document and continue your mail merge as usual.

-or-

If you are inserting database information, in the Database dialog box, click Insert Data. In the Insert Data dialog box, select either All to insert all of the results of the Microsoft Access query into your Word document or select From and specify which records you want to insert into your Word document.

NOTE: In the Insert Data dialog box, the "Insert data as field" is not selected by default. If selected, this option inserts the data into the table as a field. Select this check box if you want to update the data in your Word document whenever the data source changes.</li></ol>

How to Use MS Query to Retrieve MS Access Data as a Data Source in Word
To use Microsoft Query to retrieve Microsoft Access data as a data source in Word, follow these steps:

<ol> If you want to use the results of a Microsoft Access query or table as your data source in a Word mail merge, in the Mail Merge Helper (on the Tools menu, click Mail Merge), click Get Data and then click Open Data Source.

-or-

If you want to insert the results of a Microsoft Access query or table in a Word document, in the Database dialog box (on the Database toolbar, click Insert Database), click Get Data.

NOTE: To access the Database toolbar, on the View menu, point to Toolbars and then click Database.</li> In the Open Data Source dialog box, click MS Query.</li> In the Select Data Source dialog box, select "MS Access 7.0 Database," and then click Use.</li> In the Select Database dialog box, select the Microsoft Access database file that you want to use, and then click OK.

NOTE: If you select the Read Only check box, you will be able to read the file but cannot make changes to it. If you select the Exclusive check box, the database file will be locked during the time Word is using the Microsoft Access database.</li> In the Add Tables dialog box, select what you want to use for your query and click Add. Select each item (table or query) and add them to your query and then click Close.</li> In Microsoft Query, drag either the table or query field name (or the asterick (*) if you want all of the field names) from the Table pane to the Data pane.

For more information about the Query Window, click Contents on the Help menu in Microsoft Query Help, and then under Reference, click Query Window.</li> After you have completed your query, on the File menu click "Return Dat to Microsoft Word."</li> If you are using mail merge, MS Query will return you to the Mail Merge Helper. Click Close and then insert your merge fields and continue your mail merge as usual.

-or-

If you are inserting database information, in the Database dialog box, click Insert Data. In the Insert Data dialog box, select either All to insert all of the results of the Microsoft Access query into your Word document or select From and specify which records you want to insert into your Word document.

NOTE: In the Insert Data dialog box, the "Insert data as field" is not selected by default. If selected, this option inserts the data into the table as a field. Select this check box if you want to update the data in your Word document whenever the data source changes.</li></ol>

How to Export and Use Your Data From MS Access as a Word Data Source
To export and use your data from Microsoft Access as a Word data source, follow these steps:

<ol> Open your Microsoft Access database table or query.</li> On the File menu, click Save As/Export.</li> In the Save As dialog box, select "To an External File or Database" and then click OK.</li> In the Save dialog box, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Change the Save as type box to "Microsoft Word Merge".</li> <li>In the File name box, type a name for your exported file.</li> <li>In the Save in box, change to the folder that you want to save the file.</li></ol> </li> <li>Click Export. Microsoft Access will now export your table or query result as a tab-delimited text file.</li> <li>Close your database and quit Microsoft Access.</li></ol>

In Microsoft Word 95, continue your Word mail merge, or insert your database file as usual.

How to Copy, Paste, and Use Microsoft Access Data as a Word Data Source
To copy, pastes, and use Microsoft Access data as a Word data source, follow these steps:


 * 1) Open your Microsoft Access database table or query.
 * 2) On the Edit menu, click Select All Records.
 * 3) On the Edit menu, click Copy.

In Microsoft Word 95, following these steps:

<ol> <li>On the File menu, click New.</li> <li>On the General tab, select the Blank Document icon and then click OK.</li> <li> In your document, use one of the following methods:

Method 1: Save Data in Table Format
<ol style="list-style-type: lower-alpha;"> <li>On the Edit menu, click Paste. The information from your Microsoft Access table or query will be pasted into a Word table.</li> <li>Save (on the File menu, click Save As) this new file as (Save as type) "Word document." This new file will be your new Word data source.</li></ol>

Method 2: Save Data in Tab-delimited Format
<ol style="list-style-type: lower-alpha;"> <li>On the Edit menu, click Paste Special.</li> <li>In the Paste Special dialog box, select Unformatted Text and then click OK. The information from your Microsoft Access table or query will be pasted into your Word document as tab-delimited text.</li> <li>On the File menu, click Save As.</li> <li>In the Save As dialog box, change the Save as type box to "Text Only."</li> <li>In the File name box, type a name for your exported file.</li> <li>In the Save in box, change to the folder that you want to save the file and then click Save.</li></ol> </li> <li>Close your Word data source document and continue your Word mail merge, or insert your database file as usual.</li></ol>

<div class="references_section">