Show the text after mailmerge
Hi, there!
I am producing report with mail merge method of richedit. When mail merge complete, I want to show the text of report in a Memo component. But I can only get the text before
mail merging.(the fields are not replaced)
How can I get the text after mail merging?
I am using RIo and RB20.
Thanks in advance.
sincerely, AZA
I am producing report with mail merge method of richedit. When mail merge complete, I want to show the text of report in a Memo component. But I can only get the text before
mail merging.(the fields are not replaced)
How can I get the text after mail merging?
I am using RIo and RB20.
Thanks in advance.
sincerely, AZA
Comments
You can use the OnMailMerge event of the TppRichText component to access the resulting merged RTF or plain text. For your case, you will want to access the TppRichText.PlainText and add it to the Memo.
Something like the following: I sent a quick example of this to you as well.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for your response.
Using Memo1.Lines.Add(ppRichText1.PlainText), the RETURN infomation of the paragraph disappeared.
I am using RichEdit to show the message. like
richedit1.Lines.LoadFromStream(ppRichText1.RichTextStream)
Thank you very much!
sincerely, AZA
Calling the Add routine of TStrings in Delphi will not retain the line break information.
Try setting the Memo.Lines.Text property instead.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for your information!
Add routine doesn't retain line break! I didn't know that.
Memo will be faster that Richedit, thank you very much!
Best Regards,
AZA