Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mail Merge in VFP7
Message
From
05/06/2003 07:58:08
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00792391
Message ID:
00796578
Views:
31
>Steven,
>
>I bought the Automation book and although I was able to use their Merge method, I still have a couple of outstanding issues. First of all, I need a new set of data for each merge, and all I keep doing is adding records to the existing data.

In your code that's doing the merge, use a query to get only the records you want to merge this time and use that as the basis for creating the data source.

>Secondly, I want to automatically save the merged file and preview it, however I'm getting 3 windows - the original main document, the data source, and the preview of the merged document.

You can use automation code to close the others once the merge is done. Your best bet is to make sure you're holding onto object references to the main document and the data source, then closing them is just:

oMain.Close()
oDataSource.Close()

For the data source, you may actually have to pass a parameter to indicate that it should be closed without saving it.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform