Page 1 of 1

Replace text part of RichViewEdit1 by text part of RichViewE

Posted: Mon May 19, 2008 9:21 pm
by cm07
Hi,
I try to replace text part of RichViewEdit1 by another text part of RichViewEdit2.
I use SetItemTextA but I loose #10 and #13 caracters.

Thank you for help
Regards

Posted: Tue May 20, 2008 4:47 pm
by Sergey Tkachenko
Sorry, what do you mean by replacing text part?
If you want to copy document as a plain text (without all text and paragraph attributes, images, tables, etc.) use this code:

Code: Select all

var Stream: TStringStream;
begin
  Stream := TStringStream.Create('');
  RichViewEdit1.SaveTextToStream('', Stream, 80, False, False);
  RichViewEdit2.Clear;
  RichViewEdit2.AddTextNLA(Stream.DataString, 0, 0, 0);
  RichViewEdit2.Format;
  Stream.Free;
end;

Posted: Wed May 21, 2008 8:38 pm
by cm07
I would like to Change a text of text item with item text of another richviewedit.

Posted: Thu May 22, 2008 9:36 am
by Sergey Tkachenko
But there may be several items in the source and in the target richviewedits. For example, 5 items in RichViewEdit1 and 10 items in RichViewEdit2.
How do you define which item to copy in which item?