Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mailmerge to Word - Secifying the DataSource
Message
 
To
29/12/1999 09:53:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00309401
Message ID:
00309965
Views:
18
Thanks Cetin for the wise words. I will keep them in mind. I especially wasn't aware that Word tried to open datasource tables exclusively. In the meantime, FWIW, it turned out that the full command to make it work is:

loWord.ActiveDocument.Mailmerge.OpenDataSource( ("c:\data\mydbf.dbf" , , , , , , , , , , , "DSN=FoxPro Files;DBQ=c:\data;", "SELECT * FROM mydbf.dbf")

It apparently needed the DSN that you mentioned.

>>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
Mike C.
-------
I keep trying to find a life of my own, apart from you.
DC Talk/Charlie Peacock, In the Light.
www.risensystems.com/ra/itlbegin.rm
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform