Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word MailMerge Questionm
Message
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00475488
Message ID:
00475502
Views:
34
the object is oWordDocument. Can I reference oWord?

oWordDocument=createobject("word.basic") && Create word object

WITH oWordDocument

if !empty(tcTemplate)
.filenew(tcTemplate) && open using template table
else
.filenewdefault && no template - new file
endif

.MailMergeOpenDataSource(cDatasource,,, 1 ,,,,,,,;
cDSN+cSourceDb+cSourceType+cOther, cSQLStatement) && Open data source - Link to source
.MailMergeEditMainDocument && Activate the main document

.activedocument.saveas("c:\rt50v53\testmmsave.doc")

ENDWITH


>Use the Word object reference, not the WordDocument reference
with oWord

.ChangeFileOpenDirectory(lcSavePath)
.ActiveDocument.SaveAs(lcSaveName)
endwith
oWordDocument.SaveAs("c:\rt50v53\testmmsave.doc") should also work.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform