Article ID: 94349 - View products that this article applies to.
This article was previously published under Q94349
This article has been archived. It is offered "as is" and will no longer be updated.
Documents developed with the Text Merge feature can use fields from two or more databases. The example below uses customer names and addresses from the FoxPro 2.x CUSTOMER.DBF sample database merged with form letters contained in memo fields from a second database (INVOICE.DBF).
NOTE: This example only works using the FoxPro 2.x sample files.
The memo field contains all text to be merged. Page spacing (top, bottom, and side margins) is controlled within the memo field. A memo field can appear similar to the following example:
The following program connects the information from the two databases. Work area 1 includes the database (INVOICE) with memo fields that contain form letters. Work area 2 includes a database (CUSTOMER) that contains names and addresses that should receive the letter. The program will execute from work area 2.
<<DATE()>> <<ALLTRIM(PROPER(CONTACT))>> <<ALLTRIM(PROPER(COMPANY))>> <<ALLTRIM(PROPER(ADDRESS))>> <<ALLTRIM(PROPER(CITY))>>, <<ALLTRIM(STATE)>> <<ALLTRIM(ZIP)>> Dear <<ALLTRIM(PROPER(CONTACT))>>: This area includes the body of a letter to be sent to the contact. Sincerely, Name ENDTEXT
This example assumes that you have a customer database (CUSTOMER) with account status information and a database (INVOICE) with multiple form letters for different account statuses.
Article ID: 94349 - Last Review: February 28, 2014 - Revision: 2.2