Code: Select all
procedure TReportWriterMainForm.AddReplacementText ;
var Stream: TMemoryStream;
begin
Stream := TMemoryStream.Create;
ReplacementTextDBRichViewEdit.SaveRVFToStream(Stream, False);
Stream.Position := 0;
rve.AppendRVFFromStream(Stream, -1 );
Stream.Free;
rve.Format;
end;
How do I find the previous word in a sentence related to my current cursor position? Of course it could be the first word in the sentence or in the middle of a sentence that needs to be replaced. It won't always be the last word.
I have done all the programming to look up the replacement text. The only problem I have left is finding the word before my cursor and replacing the word with my replacment text which is "stored" in a DBRichView.