Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to define letter template, merge, and print form VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00958222
Message ID:
00962094
Vues:
12
>What I do in one application is to combine RTF text maintained in VFP with Word to do "merges." I have template pieces in RTF format (the user may combine multiple pieces to make one final word document). The merge is done with Word automation from VFP, not by Word's merge function (Word wouldn't respect RTF codes in a traditional Word "merge"). The user picks the RTF templates and a Word DOT template file.
>
>The Word DOT file may be as simple as this:
>
><<Customer>>
>
>Dear <<Salutation>>
>
><<Letter>>
>
>Sincerely,
>
>
><<Signer>>
>
><<PostScript>>
>
>
>The reason I use Word, rather than attempting this completly in VFP, is the extensive page control features of Word (Headers, footers, margins, text flow, the ability to specify printer tray by first or subsequent pages, etc). Users who regularly do merge mailings are also usually already familiar with the tricks to get Word to print properly -- or at least the problems are Microsoft's fault :) ).
>
>I allow users to insert merge fields in either the RTF "templates" or in the DOT. For my users, the big advantage of combining VFP and Word is the ability to "merge" together into one print run a large number of unique letters. As long as the paper type is the same, they can run one big print run -- some letters even with customized text. Prior to this, they had to run sometimes hundreds of seperate, small print runs for each "template" and any custom letters needed to be manually produced.
>
>Outside of the standard Word automation issues, the only realy "gottcha" was that the RTF text needs to be inserted into Word by automating a copy-and-paste through the Window's clipboard.

Thank you Dan. I may get back to you.

For the moment I am doing the merge all in VFP, using Word to create the "template" (actually an RTF document), which can be tweaked in an RTF textbox in VFP. The finished product can be viewed one document at a time in another RTF box, printed, or exported to Word (in RTF format). I also use a table as a data dictionary to give friendlier names to our table fields.

Thanks.

Alex
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform