Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word with Variable DataSource
Message
 
À
21/03/2002 07:34:58
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00635395
Message ID:
00635432
Vues:
26
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform