Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word with Variable DataSource
Message
 
To
21/03/2002 07:34:58
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00635395
Message ID:
00635432
Views:
27
>You can't really prevent the datasource from being saved with the document. However, you can prevent an error if the datasource is missing when you open the document with Automation. Just set oWord.DisplayAlerts to .F. Then you can use the OpenDataSource method of the MailMerge object to attach the datasource you want to use for this merge. Code looks like:
>
>oWord.DisplayAlerts = .F.
>oDoc = oWord.Documents.Open(cTheFile)
>oDoc.MailMerge.OpenDataSource( cNewDataSource )
>oDoc.MailMerge.Execute()
>
>Tamar

Tamar,

This is what I have been trying all morning (variations on this theme any way) however when I run your code at the Document.Open line it then opens the "OpenDataSource" dialog and user action is required. Is there any way to stop that dialog coming up so I can set the OpenDataSource in the code?

Thanks for your help.
Caroline
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform