Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word/excel merge automation
Message
 
To
23/01/2006 03:47:25
Michael Ouellette
Australian Technical Services (VIC) Pty
Australia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01089289
Message ID:
01089290
Views:
20
>I have to keep setting the datasource to my excel file every time I open the file from VFP
>After setting the datasource I get asked if the First row of data contains column headers
>After selecting OK I can the automate to my hearts content
>How can I bypass this dialog? or how can I open the document with the datasource attached?
>Thanks
>
>The code:
>
>
>oWord = Createobject('Word.Application')
>oword.setvisible(.T.)
>*--lcfilename is a wordmerge doc that is already attached to an excel file
>lcfilename = SYS(5)+SYS(2003)+"\templates\mydoc.dot")
>oword.Documents.open(lcfilename) && chage to .Documents.add and same issue
>*-- Above opens file with merge fields but NO datasource!oword.ActiveDocument.MailMerge.OpenDataSource( tcFileName, ;
>0, .F.,,.T.,,,,,,,"Entire Spreadsheet" )
>
>*-- opening the file from explorer by double clicking on it opens the file with the datasource!
>
Try with:
oWord.DisplayAlerts = 0
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform