General information
Category:
COM/DCOM and OLE Automation
I am using Office 97 but my client is using Office 2000. I am using Visual Extend as my framework. This is called from a button, and my code in my button is:
****
local lcexcelfile, lctemplate, lcnewdocument
lcexcelfile = GETENV("temp")+"\X"+sys(2015)+".xls"
lctemplate = GETFILE('dot', 'Get the .dot file:', 'OK',1)
*** SELECTED view is current here ****
copy to (lcexcelfile) xls
thisform.addobject("owordobject","word")
with thisform.owordobject
.openWord()
.activateWord()
.nsavechanges = -2
lcnewdocument = .addDocument(lctemplate)
if !.lopendocument_ok
=MESSAGEBOX("Can't open document template!", 0+64+0, _screen.caption)
delete file (lcexcelfile)
thisform.removeobject(thisform.owordobject.name)
release owordobject
return .f.
endif
.MailMerge(0, lcexcelfile)
.ViewMergeFieldCodes()
.goBottomofDocument()
.editDocument()
.closedocument(lcnewdocument)
endwith
******
Thanks for the help
Sandi
>Sandi:
>
>I need to pick up a sample from home and I will send it tomorrow morning. Please specify version of Word that you are using.
>
>Daniel
Previous
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