Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to automate mailmerge form vfp7
Message
From
05/02/2004 16:25:43
 
 
To
05/02/2004 14:56:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00874569
Message ID:
00874602
Views:
7
You are missing a couple of things
oWord=CREATEOBJECT('Word.Application')
oWord.Documents.Open("formletter.doc")
oDoc=oWord.ActiveDocument
WITH oDoc
.Destination = 1 
.Execute()
endwith
oWord.quit
try that.


>I've got all the records to print in a .dbf, which I then copy to .xls. I have a Word .doc template, already set up to use the .xls file as data, ready for mail merge to print. All I had to do is to run my vfp program to get my records into the .dbf & .xls, then I open up the .doc template file, & since this template file is already set up to use the .xls file, I just mail merge to printer, all records.
>
>I'd like to automate this through vfp, so that users do not have to get out of vfp & into word to print the mail merged documents. I have this code setup in vfp, but it does not work:
>oWord=CREATEOBJECT('Word.Application')
>oWord.Documents.Open("formletter.doc")
>oDoc=oWord.ActiveDocument
>oDoc.MailMerge.Execute()
>
>I'd like vfp to automatically print the mail merged documents from within vfp. Is that possible? What am I missing / doing wrong?
>Thanks all!
Previous
Reply
Map
View

Click here to load this message in the networking platform