replace every occurrence of a text by another text

General TRichView support forum. Please post your questions here
Post Reply
Usch Wildt
Posts: 20
Joined: Fri Sep 29, 2006 11:30 am

replace every occurrence of a text by another text

Post by Usch Wildt »

Hi,

it sounds very simple, but I dont' find a way for this:

I habe a formatted text in a TRichViewEdit control.
There can be tables in the text.

Now I want to find any occurence (also in tables) of a text snippet, e.g. "xyz" and replace it by another text, e.g. "example text".

The formatting of the replaced text shall be the same as in the original text, e.g. if one ocurrence of "xyz" is bold, the "example text" shall also be bold this time.
If the next occurence of "xyz" is italic, the "example text" shall also be italic this time.

SearchText and InsertText seem to crash with tables.
In your field-replace-examples the fields have special formats and are seperate items.
So both ways don't work for me.

Could you give me a small C++ code example?

Thanks a lot!

Usch Wildt
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

SearchText and InsertText must work in tables.
You can see the demo in "Demos\CBuilder\Assorted\Search and Replace\"
Replace All command is implemented there.
Post Reply