>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