General information
Category:
COM/DCOM and OLE Automation
>From within VFP 6, how can i initiate Word, pass it the merge document, and get Word to initiate the mail merge function, using an excel file created from VFP.
> i have been able to initiate Word using DDEInitiate command, but cant get any further... could really use location of documentation on word macro's and how to call (params & such) from VFP, or examples to work with....
As Luis said, Automation is a better choice here. But as long as you're using Word 97 or later, you should work with the Word.Application object rather than the Word.Basic object.
This code opens Word, opens your mail merge document and merges it with the Excel file.
oWord = CreateObject("Word.Application")
oDoc = oWord.Documents.Open( )
oDoc.MailMerge.OpenDataSource( , 0, .F.,;
,.t.,,,,,,,"Entire Spreadsheet" )
Tamar
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only