Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating Form Letters using VFP data
Message
De
27/10/1998 21:31:07
 
 
À
27/10/1998 15:52:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00150130
Message ID:
00151355
Vues:
18
Robert,
From the programming point of view all you need to do is create a database of names and addresses and any other fields the users might want to put on a document. You need to design some sort of interface for your users to select which records they wan't.

Now, open Word for Windows (I've used 6 and 97 - both much the same)
Select Tools|Mail Merge. You will see there are three steps.
1. Create a document. Choose, say, form letter and use the current document, or create a new one. Just type any old stuff in there.
2. Data source. Choose Get data/Open data source. In the dialog you will see a "Files of Type" combo. If it's there select MS Foxpro files, failing that select dBase files. (If neither are there you will need to install the ODBC drivers that come with Office Professional). Select a .dbf file from somewhere on disk, again I think you need a "Fox2x" type dbf or a dbase file (see below).
3. You will find then that you can simple insert data base fields into the document and do lots of cool stuff with it, including setting filters etc. This is the bit that the users could play with, or you could set up some "templates" youself.

If you haven't got access to the odbc drivers, then you could select your table and COPY TO export.xls TYPE XLS and use Excel as the data source in step 2.

To create Fox2x type Dbfs use "COPY TO export.dbf TYPE FOX2X". I *know* that these are readable by Word. VFP files might be too, but I haven't tried.

HTH.



>David,
>I would love to have some sample code to do this "mail merge". If possible can you send me a sample word document along with a table and program. I am really lost when it comes to word processing. Send instructions on the back of a $20 bill or email me at robertmos@aol.com
>Thanks
>
>>>>>What is a good way to create form letters in a VFP application and insert data from a table into each letter like a mail merge file?
>>>>
>>>>Another way is (if your client has Office Professional) to simply create a table, and fire up a pre-written word document which references the fields in the table. (See Mail-Merge/Set datasource options in Word) This makes it very easy for the user(s) to amend the form letter, and is so simple to program. It then allows all the powerful native features of Word merge facilities.
>>>>
>>>>BTW, I'm not sure, but you may need to create the table as a Foxpro 2.6 version, but that's fairly easy too (COPY TO...)
>>>>
>>>>HTH
>>>
>>>David,
>>>
>>>Thanks for the reply. I guess that I will have to give them a way to select the data then export it so they can do a mail merge from word.
>>
>>If you need any help there I've been down this track with a real-estate mail merge system using Word as the merge program. Just holler and I can email you some stuff
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform