Microsoft Word's mail merge feature can work directly with data that is stored on the iSeries. You can use this to print a Word document using variable data generated by iSeries programs.
 
For example: Print a PC-based document that includes logos and graphics combined with data from the iSeries.
 
Prerequisites:
  • An AS/400 ODBC driver, such as IBM Client Access ODBC driver, which comes with Client Access Express or Client Access for Windows 95/NT.
  • On the PC, Microsoft Query, an optional part of Microsoft Office.
 
To create a new Word mail-merge document that links to the iSeries: 
  1. On the iSeries, use the ODBC Administrator and the ODBC driver to create a new data source with the names of the iSeries system and library where the data files reside.
  2. On the PC, in Word, go to Tools > Mail Merge.

    Mail Merge Helper displays.

  3. Click the Create, Form Letter, and Active Window options.

    The mail-merge toolbar is added to the Word document.

  4. Click the Get Data and Open Data Source options.

    Open Data Source displays.

  5. Click MS Query.

    Choose Data Source displays.

  6. Choose the name of the data source you created in step 1 and click OK.

    Note: You may have to enter your iSeries user ID and password.

    Add Tables displays.

  7. Choose the tables that contain the field to include in the mail merge.

    Each table you choose is added to the Query pane.

  8. When you've finished choosing tables, in Add Tables, click Close.
  9. Drag and drop the fields to include in the mail merge from the Query pane to the Grid pane.

    Note: To select all fields, double-click the asterisk (*)  at the top of the fields list.

  10. From the Microsoft Query menu, click File > Return Data to Microsoft Word.

    Note: You may have to enter your iSeries user ID and password.

    A message box displays that "Word found no merge fields in your main document."

  11. In the message box, click Edit Main Document.
  12. In Word, in the mail-merge toolbar, enable Insert Merge Field.
  13. In the Word document, type any text and insert graphics.
  14. Place your cursor where you want a merge field and, in Insert Merge Field, choose the field from the list.

    The field displays in the document surrounded by double brackets (<< >>).

  15. After you are finished with the document, on the mail-merge toolbar, click Merge.

    Merge dislays.

  16. In the dialog box, click Merge.

    The document displays, containing all the merged iSeries data.

  17. To print the document, click Print.

Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016