ContentsIndex PreviousNext

To access data from Word for Windows Version 7.0

The following procedure describes how to access your COBOL data from Microsoft Word for Windows Version 7.0, the word processing component of Microsoft Office 95. Another procedure has been provided for users of Word 2000 (the version that comes with Microsoft Office 2000). If you have a different version of Word, follow whichever procedure you desire. Even though your steps may be slightly different, the concepts will be largely the same.

To access data from Word 7.0:

1. Start Word for Windows.

2. Open the document into which you want to insert data.

3. Select "Mail Merge" from the Tools menu.

4. A dialog box displays. Under "Main Document," click "Create" and select "Form Letters."

A dialog box displays.

5. To insert data into the active window in Word, select "Active Window."

6. Under "Data Source," click "Get Data" and select "Open Data Source".

The "Open Data Source" dialog box displays.

7. Select the "MS Query" button on the right of the screen. This invokes Microsoft Query. (If you do not have an "MS Query" button, you may need to install MS Query on your machine.)

The Select Data Source dialog box displays.

8. Click on "Other. . . " The "ODBC Data Sources" dialog box displays. This lists all of the DSNs that you have established for ODBC. (Refer to Section 3.1, Data Source Names (DSNs), for instructions on creating DSNs.)

9. Select the DSN that corresponds to the data source you want to access. The previous dialog box displays again, this time with the new DSN listed.

10. Click "Use." A dialog box displays. This box lets you select the tables to add to your Word document.

11. Select the table or tables that you want to add (e.g., "customer"), then click "Add." Close the box when you're done. For each table you selected, a list box displays on the MS Query screen. This list box lists all of the columns in the associated table.

12. Double-click each column that you want to read into your Word document, and that column displays on the screen. If you want to add all columns, double click the "*" at the top of the list box.

13. To enter a SQL statement, click the "SQL" button on the button bar. A dialog box displays.

In this box, type the SQL statement you want to invoke. Press "OK" when you're done. (For a description of the SQL commands supported by AcuODBC, refer to Section 6.3, SQL Syntax Supported by AcuODBC.)

14. Select "Return Data to MS Word" from the MS Query File menu. You are returned to MS Word for Windows.

15. Close the active dialog box in Word. Notice that new mail merge buttons are added to the toolbar.

16. Place the cursor in your document where you want to insert the data. Click the "Insert Merge Field" button. A pull down list of table columns displays. These are the columns that you selected in MS Query.

17. Select the merge field of interest. The control characters for this field are placed in your document. To display the exact data in this field, click the "<<ABC>>" button.

Finish your document as you normally would. Whenever you want to insert a COBOL data field, click "Insert Merge Field" once again and select the appropriate field. To move to the next, previous, first, or last record in the table, click the corresponding radio button on the toolbar.

For more instructions on using Word's mail merge feature, refer to your Microsoft documentation.