merge table rows

General TRichView support forum. Please post your questions here
Post Reply
vector
Posts: 3
Joined: Wed May 08, 2019 11:44 am

merge table rows

Post by vector »

Hello!

I have a rtf document opened in richchedit, with two tables.
How can i insert the second table 3. row into first table 9. row?
Please help me. The structure of the tables is unknow, because it made by user.

Thank you!
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: merge table rows

Post by Sergey Tkachenko »

Code: Select all

var
  Stream: TMemoryStream;

  Stream := TMemoryStream.Create;
  table2.SaveRowsToStream(Stream, 9, 1);
  Stream.Position := 0;
  table2.LoadFromStreamEx(3, 0, False);
  Stream.Free;
  RichView1.Format;
This code works if tables are in the same editor.
If rows are incompatible, LoadFromStreamEx raises an exception.
Post Reply