Information générale
Catégorie:
COM/DCOM et 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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement