Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to define letter template, merge, and print form VFP
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00958222
Message ID:
00961369
Views:
11
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.



>We would like to give our users the capability to define a letter template in a Rich Text Format box, merge it with data, and print it all from within our application.
>
>How can I accomplish this?
>
>TIA,
>
>Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform