Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Initiating Word Mail Merge
Message
From
12/03/2001 13:34:20
 
 
To
12/03/2001 10:20:38
Jim Harty
FL Dept Fin Services-Div of Rehab & Liq
Tallahassee, Florida, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00484036
Message ID:
00484159
Views:
18
>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
Map
View

Click here to load this message in the networking platform