Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP/Word 2003 Merge Exception
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00887491
Message ID:
00887853
Views:
12
Hi Borislav,

Thanks for taking the time to reply on this.

>oMW=Createobject("word.application")
>oMW.documents.open('Letter.doc')
>oDoc = oMW.activedocument

>oDoc.MailMerge.OpenDataSource("YpurDataSource.DBF")

>oDoc.mailmerge.execute


I get "error opening data source" after addintg the OpenDataSource statement. The merge doc, with data source defined, is all setup already in Word 2003 and works perfectly when executed manualy through Word. That indicates that the data souce dbf is accessible and not corrupted. Not sure why I would need to open the data source anyway when automating through VFP since it happens automatically when the merge document is opened manually in Word.

Back to the original Ole Dispatch Error: "This method or property not available because the document is not a mail merge main document". I wonder if I need to specify the active document, and how to do that, before executing the merge.

Todd
The day you take complete responsibly for yourself, the day you stop making any excuses, thats the day you start to the top. - O.J. Simpson

Great advice from a questionable source...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform