Hi Ravinder, and welcome to the forum.
What you need to do is to put place-holders in the memo field, at the points where you want to insert the variable text.
For example, suppose you want the letter to say:
Dear Mr Rockefeller,
Thank you for letter of 2 August 2013.
where "Mr. Rockefeller" and "2 August 2013" are variable text that you obtain from another table.
You would replace these variables with place-holders, for example:
Dear #1#,
Thank you for letter of #2#.
I've used #n# for the place-holders in this example, but you could choose whatever combination of characters you prefer.
When the time comes to generate the letter, you can do so like this:
Code:
* Assume TableA contains the memo field, named MemoField;
* Table B contains the investor's name (InvestName) and date of last letter (LetterDate)
lcGeneratedText = STRTRAN(TableA.MemoField, "#1#", TableB.InvestName)
lcGeneratedText = STRTRAN(lcGeneratedText, "#2#", TableB.LetterDate)
* lcGeneratedText now contains the new text, which you can to ahead and print.
Obviously, this is greatly simplified, but it should give you the general idea.
Be aware that this method is not particularly flexible. Also, it does not allow you to vary the formatting or style of the generated text. You cannot format individual words or phrases in different fonts, or use bold and underline, for example. If that's an issue, you should consider using mailmerge with Office Automation. If that's of interest, we can give you more guidance, but it's more complicated than the method I've outlined above.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads