Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mail Merge in VFP7
Message
From
23/06/2003 09:45:29
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00792391
Message ID:
00802885
Views:
34
>Hi Tamar,
>
>Thanks for the assistance. After I use Automation to execute a merge, the datasource is the topmost active document. If I close it, then I get the print preview. If I close() it in my routine I get an OLE exception from Word. Is there a way I can hide it, or some other way of closing it?
>

I'm a little confused by what you say you're seeing. When you've finished the merge, there should be three open documents: the main document, the data source and the merged result.

You can close both the main document and the data source. The easiest way to do this is to make sure you have a object reference to each before executing the merge. Then you can use those object references to close those documents.

My experience is that the merged result is the active document after a merge, but I suppose that could vary with the Word version. Unfortunately, the MailMerge.Execute method doesn't give you back an object reference to the result, but if it's the active document, it's easy to grab one.

Unless you choose to execute a Preview (as the sample code in AutoFox does), you shouldn't be seeing a print preview at all.

What's the goal here? Are you trying to print the merged result? Save it? something else?

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform