Simple Search and Replace
Posted: Tue Dec 27, 2016 1:28 pm
Having searched whatever I could on this topic and trying numerous approaches over the last day and a half I have to admit I cannot figure out this simple task.
I load a template file in rtf format into a ScaleRichView and search for something like [LastName] and replace it with something like Walsh
Here is the simplest code I could fine
with RVEPreview do
begin
RichViewEdit.SetSelectionBounds(0, RichViewEdit.GetOffsBeforeItem(0), 0, RichViewEdit.GetOffsBeforeItem(0));
while RichViewEdit.SearchText('['+OldWord+']', [rvseoDown,rvseoWholeWord]) do
RichViewEdit.InsertText(NewWord);
end;
soon as it tries the SearchText statement I get the following error
List index out of bounds (-1)
My versions are ScaleRichView 7.5 and Richview 16.9
Thanks for any help you might offer
Don
I load a template file in rtf format into a ScaleRichView and search for something like [LastName] and replace it with something like Walsh
Here is the simplest code I could fine
with RVEPreview do
begin
RichViewEdit.SetSelectionBounds(0, RichViewEdit.GetOffsBeforeItem(0), 0, RichViewEdit.GetOffsBeforeItem(0));
while RichViewEdit.SearchText('['+OldWord+']', [rvseoDown,rvseoWholeWord]) do
RichViewEdit.InsertText(NewWord);
end;
soon as it tries the SearchText statement I get the following error
List index out of bounds (-1)
My versions are ScaleRichView 7.5 and Richview 16.9
Thanks for any help you might offer
Don