ACC: Using Data from MS Access in a WordPerfect Mail Merge

Last reviewed: June 3, 1997
Article ID: Q104916
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97
  • WordPerfect for DOS, versions 5.1, 6.0
  • WordPerfect for Windows, versions 5.1, 5.2

SUMMARY

Moderate: Requires basic macro, coding, and interoperability skills.

The following information describes how to prepare data in a Microsoft Access database to use in a mail merge in WordPerfect for DOS or WordPerfect for Windows.

MORE INFORMATION

WordPerfect for Windows and WordPerfect for DOS cannot read data from Microsoft Access in its native format. To use data from a Microsoft Access database in a WordPerfect mail merge, you must export the data from Microsoft Access in a format that WordPerfect recognizes as a valid mail merge data file (also called a "secondary file"). WordPerfect can use Delimited Text or dBASE data files as secondary files in a mail merge.

The following information discusses how to export data from Microsoft Access for use in a WordPerfect mail merge.

Exporting Data from Microsoft Access for Use in WordPerfect

In Microsoft Access 7.0 and 97:

  1. Start Microsoft Access and open the sample database Northwind.mdb.

  2. Select the Customers table in the Database window.

  3. On the File menu, click Save As/Export.

  4. In the Save As Dialog box, click To an External File or Database.

  5. In the Save Table 'Customers' In... dialog box, select Text Files, dBASE III, or dBASE IV in the Save as type box.

  6. Click the Export button.

  7. If you are exporting to a text file, the Export Text Wizard (or Text Export Wizard in version 7.0) appears. Click the Advanced button and set the following options:

          Field Delimiter: {tab}
          Text Qualifier: {none}
    

    Click OK, and then click Finish to export the data.

    TIP: If you export data regularly to WordPerfect, you can click the Save As button in the Export Specification dialog box to save the Export options. That way you can avoid having to specify these options each time you export data.

In Microsoft Access 1.x and 2.0:

  1. Start Microsoft Access and open the sample database NWIND.MDB.

  2. On the File menu, click Export.

  3. In the Export dialog box, select Text (Delimited), dBASE III, or dBASE IV, and then click OK.

  4. Select the Customers table, and then click OK.

  5. In the Export to File dialog box, choose a directory and a file name for the exported data, and then click OK.

  6. If you are exporting a delimited text file, the Export Text Options dialog box appears. Click the Options button and set the following options:

          Text Delimiter: {none}
          Field Separator: {tab}
    

    Click OK to export the data.

    TIP: If you export data regularly to WordPerfect, you can click the Save As button to save the Export Text Options. That way you can avoid having to specify these options each time you export data.

Performing a WordPerfect Mail Merge with Microsoft Access Data

A WordPerfect mail merge is the process of combining information from two documents: a "primary file" (or form file) and a "secondary file" (or data file) to create a single merged document.

The primary file, which is typically a form letter, is used to direct the merging process. The secondary file contains records of information, typically names and addresses, that WordPerfect uses to complete the primary file. The primary file contains placeholders (fields) that indicate where specific information from the secondary file, such as a first name or an address, should appear.

The placeholders appear in the primary file starting with {FIELD} followed by a number indicating which field in the secondary file to use. The placeholder ends with a tilde character (~). For example, {FIELD}2~ indicates the placeholder for the second field in the secondary data file. In the Customer file exported earlier, this is the Company Name field.

NOTE: In WordPerfect version 6.0 for DOS the field looks like FIELD(2).

The fields appear in the secondary file in the same order as they appear in Microsoft Access. The fields in the Customers table in the Northwind.mdb (or NWIND.MDB) database are in the following order:

   1. CustomerID    (or Customer ID in versions 1.x and 2.0)
   2. CompanyName   (or Company Name in versions 1.x and 2.0)
   3. ContactName   (or Contact Name in versions 1.x and 2.0)
   4. ContactTitle  (or Contact Title in versions 1.x and 2.0)
   5. Address
   6. City
   7. Region
   8. PostalCode    (or Postal Code in versions 1.x and 2.0)
   9. Country
  10. Phone
  11. Fax

When you create the primary file in WordPerfect, you can always refer to the field numbers in the same order as they appear in your Microsoft Access table or query.

REFERENCES

For more information about exporting data in Microsoft Access, search the Help Index for "exporting data."


Additional query words: wp51 wpwin print merge
Keywords : IntpOthr kbinterop
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.