Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word/excel merge automation
Message
 
À
23/01/2006 03:47:25
Michael Ouellette
Australian Technical Services (VIC) Pty
Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01089289
Message ID:
01089290
Vues:
19
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform