Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation Tribulation
Message
 
To
17/11/2001 10:20:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00583019
Message ID:
00583604
Views:
27
Hi Cetin,

Thanks for your reply and sample code. In researching this problem I had already studied some of your previous messages related to Word automation. Your understanding in this area is really quite amazing!

In the end I opted to define the data source (a dbf) for my merge document within the document itself. After executing an SQL statement to create the dbf file, the code below seemed to do the trick:


public oMW
oMW=createobject("word.application")
with oMW
.visible = .f.
.documents.open('c:\nnjvfp\include\nnj violation letter 1.doc')
.activedocument.mailmerge.execute
.application.options.printbackground = .t.
.activedocument.printout(.t.)
do while .application.backgroundprintingstatus > 0
enddo
.activedocument.close(.f.) && close the merge document without saving
.activedocument.close(.f.) && close merge template doc without saving
.quit()
endwith
oMW = ''


Thanks again for your help!
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
Reply
Map
View

Click here to load this message in the networking platform