Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merges with Word 2000 and VFP 6.0

Status
Not open for further replies.

donser

Programmer
Jul 31, 2001
7
US
What is the most efficient way of doing Mail Merges using Word 2000 and VFP 6.0. I have a form letter that I wish to insert the full name after word 'DEAR' Full name comes from a data base. I have tried using WORD'S mail merge FUNCTION but if you have a very large letters, like a thousand names or more, it takes for ever for WORD to do the mail merge. Can VFP do it more efficiently and quicker? If so please let me know. Thanks.
 
You found the best way... it takes just as long (if not longer) for VFP to automate Word and create a thousand pages filled with text. I have working code automating Word to create the mailmerge letter and to execute the mailmerge if you need any advice on that part.
 
If you dont have any fancy formating like tables or graphics, and you dont change the letter much, you can actually "embed" the form letter in a program file with :
? 'Dear '+Firstname
** prints a line e.g.
? 'This is the first line following the salutation'

and ?? 'Prints continuation on the same line'

or
TEXT
This is the first line following the salutation
...
Sincerely,
Steve Numbat
ENDTEXT

you can even embed variables within the Text...Endtext, see the help file entry for it <<var>> .

Bold, italics, etc can be included by hardcoding printer controls (i.e. ? chr(27)+'i'+'mite print italics', but anything more fancy is not available using this method, really, without megawork.

ANOTHER alternative is to embed your DOC file in a memo or general field and use the report generator to print the mailmerge. This also takes some trial and error to get the final product, but its not too hard.

All of these have the advantage of spooling the entire report out without built in delays, making the speed entirely dependant on your printer. The CPU will generally finish WAY before the printer does.

Hope this helps.
 
If the letter is very simple, you could just use report writer. I find it very fast for simple form letters. Just set the group to recno() and check new page when group changes. You can even place the letter body into a memo record Steve Bowman
steve.bowman@ultraex.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top