Replace text part of RichViewEdit1 by text part of RichViewE

General TRichView support forum. Please post your questions here
Post Reply
cm07
Posts: 2
Joined: Mon May 19, 2008 9:08 pm

Replace text part of RichViewEdit1 by text part of RichViewE

Post 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
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
cm07
Posts: 2
Joined: Mon May 19, 2008 9:08 pm

Post by cm07 »

I would like to Change a text of text item with item text of another richviewedit.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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?
Post Reply