Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mailmerge to Word - Secifying the DataSource
Message
De
29/12/1999 09:53:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00309401
Message ID:
00309818
Vues:
23
>I am trying to do a mailmerge with Word. I tried to specify the data source from VFP (rather than have it specified in the Word template, which was causing other problems). It almost works, but Word comes up asking if this is a 'FoxPro or dBase' file.
>
>My command is:
>loWord.ActiveDocument.Mailmerge.OpenDataSource("c:\mydbf.dbf")
>
>It seems like there must be a way to identify the file as FoxPro programmatically, but I can't see how. Has anyone run across this?
>
>Thanks in advance.


Michael,
I would say don't try it. It could work today but not tomorrow. Since new MDAC 2.1 is introduced support for FP2.x tables are dropped and only VFP databases are supported. Also Word tries exclusive access to tables which might not be suitable for an app. Especially if table has memo fields you get errors (including couldn't find installable ISAM, cannot open datasource etc). In files section (I don't remember what's the last version there) I have uplodaded a mailmerge class lon ago. Check its code to define DSN for using Fox tables.
Instead now what I do is to copy data to clipboard and paste in Word, convert to table and save as datasource. Editmanindocument and set datasource to saved doc. Works fast and w/o suffers from ODBC (I suspect its meaning).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform