Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ole Woes
Message
From
10/04/2000 13:02:04
 
 
To
07/04/2000 16:12:22
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00348576
Message ID:
00357590
Views:
20
Code opens up a word document with an excel merge file... (Office 97 or 2000)

#Define DWORD_DOCUMENT sys(5)+ curdir()+ allt(THIS.DOCUMENT_FILE_NAME)
#Define DEXCEL_DOCUMENT sys(5)+ curdir()+ allt(THIS.EXCEL_FILE_NAME)

odoc=.null.
odoc=crea('word.document')


*--- is this a new docoment
If !file(DWORD_DOCUMENT)


If !FILE('MERGET.DOT')
=MESSAGEBOX('Required Merge File Not Found - Call ',16,'SYSTEM MESSAGE')
odoc=.NULL.
Return
Else
JLINE='COPY FILE MERGET.DOT TO '+ DWORD_DOCUMENT
&JLINE
Endif
Endif

odoc.application.documents.open(DWORD_DOCUMENT)
odoc.application.activedocument.mailmerge.opendatasource(DEXCEL_DOCUMENT,.f.,.f.,.t.,.f.,1,'','',1,'','','Entire Spreadsheet')


>Hi Sébastien,
> I am working on a Label/Merge routine in MS Word2000. It is running in
>vfp6.0. I have my data source setup and running and when I run the execute
>command it goes and pops out the labels in a new word document as expected.
>
>But when I run it on another machine I get an Error 1429, the current Mail
>merge Main Document has no merge fields.
>
>Is there a way to programatically to setup the merge fields in the main document before the execute?
>
>I have tried to capture the setup in a word macro, but word does not save
>anything like that.
Thanks,

Stacy



Black Mountain Software, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform