General information
Category:
COM/DCOM and OLE Automation
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only