Page 1 of 1
Replace text in TppRichView
Posted: Mon Oct 31, 2005 7:11 pm
by Mauro
Hello, it's me again
Does exist a Demo or some help topic that explains how to replace text in the TppRichView (or a workaround)?
I'm trying to do a MailMerge engine.
Regards,
Mauro.
Posted: Mon Oct 31, 2005 7:56 pm
by Michel
Hi Mauro, it's me again too
Yes, there's the "Mail Merge" demo towards the middle of
http://www.trichview.com/download/demo.html
Should give you some initial ideas.
Michel
Posted: Tue Nov 01, 2005 10:41 am
by Mauro
Hi,
I've already seem these demos.
But I've not found .InsertText nor anything like this in TppRichView (the rich view for ReportBuilder).
I'd know if in fact there's no way to do this directly in TppRichView. If no then I'll use an invisible TRichViewEdit, replace the text using the idea existing in the demo, and at last save the RVF from TRichViewEdit to TppRichView.
Thanks,
Mauro.
Posted: Wed Nov 02, 2005 9:42 pm
by Sergey Tkachenko
There are many mailmerge demos (you can see them all here:
http://www.trichview.com/forums/viewtopic.php?t=8 ), and none of them requires editor or InserText method. All of them work with TRichView (and TRichView object is accessible as ppRichView.RichView)
Posted: Thu Nov 03, 2005 11:37 am
by Mauro
Hello,
Excuse me by the insistence...
I've read the demos, but haven't understood the engine.
I'm using the following to do the replacement in the RichViewEdit:
Code: Select all
//Go to begin
Item := 0;
Off := rveTexto.GetOffsBeforeItem(Item);
rveTexto.SetSelectionBounds(Item,Off,Item,Off);
//Replace
while rveTexto.SearchText(Old, [rvseoDown]) do
rveTexto.InsertText(New);
Is there any way as simple as this to do the same using RichView?
Posted: Thu Nov 03, 2005 11:47 am
by Sergey Tkachenko
No, you cannot use these methods in TRichView.
It's not necessary to understand mail-merge demos code completely. Usually, you can just copy the main procedure (FillFields) in you project without changes.
Or, as you suggested initially, use a hidden richviewedit. It's ok, but much slower.