

The following procedure describes how to access your COBOL data from Microsoft Word 2000, the word processing component of Microsoft Office 2000. Another procedure has been provided for users of Word for Windows Version 7.0 (the version that came with Microsoft Office 95). 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.
1. Start Word 2000.
2. Open the document into which you want to insert data.
3. Select "Mail Merge" from the Tools menu. To locate the "Mail Merge" option, point to the expansion arrows on the bottom of 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 bottom 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 "Choose Data Source" dialog box displays.
If you want to use MS Query's "Query Wizard" to create your SQL query, leave the "Use Query Wizard" checkbox checked. Refer to MS Query's online documentation for instructions on using the Query Wizard.
For simplicity, deselect the Query Wizard.
8. Select the DSN that corresponds to the data source you want to access and click "OK." (Refer to Section 3.1, Data Source Names (DSNs), for instructions on creating DSNs.) A dialog box displays. This box lets you select the tables to add to your Word document.
9. 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.
10. 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.
11. To enter a SQL statement, click the "SQL" button on the button bar. A dialog box displays.
12. 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.)
13. Select "Return Data to MS Word" from the MS Query File menu. You are returned to MS Word for Windows.
14. Close the active dialog box in Word. Notice that new mail merge buttons are added to the toolbar.
15. 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.
16. 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.