Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can we run microsoft word's mail merge letters from VFP?
Message
From
26/04/2002 14:11:19
 
 
To
26/04/2002 11:03:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00649620
Message ID:
00649731
Views:
9
Hi Inge,

>I have collected data into an excel document:
>SELECT * FROM myTable
>COPY TO c:\temp\tempxls TYPE XLS
>
>I have created a form letter in Microsoft Word (data from tempxls). Can I print this form letter from within my VFP program?
>
>Thank you all!

Yes. You want to use Office Automation. A simple outline of what you might need is:
oWord = CREATEOBJECT('Word.Application')
oWord.Documents.Open("MyMergeDoc.doc")
oDoc = oWord.ActiveDocument
oDoc.MailMerge.Execute()
There are a few more subtlties to making it work smoothly and changing the data, but its not too difficult.

Check out the example of Fox automation in the VFP samples for more ideas about automation.
Do Home() + "Samples\Solution\Solution.app"

You also might want to go to www.hentzenwerke.com and purchase "Office Automation in Visual FoxPro"

Pamela
Previous
Reply
Map
View

Click here to load this message in the networking platform