Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mail Merge Problem with Data
Message
De
14/11/2000 14:08:53
 
 
À
14/11/2000 13:51:00
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00441728
Message ID:
00441749
Vues:
12
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
Fil
Voir

Click here to load this message in the networking platform