Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mail Merge Problem with Data
Message
From
14/11/2000 14:08:53
 
 
To
14/11/2000 13:51:00
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00441728
Message ID:
00441749
Views:
7
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
Map
View

Click here to load this message in the networking platform