Insert in a single file the contents of varios richviewedits

General TRichView support forum. Please post your questions here
Post Reply
VT
Posts: 18
Joined: Mon Jul 31, 2006 1:39 pm

Insert in a single file the contents of varios richviewedits

Post by VT »

How can i assign the contents of varios richviewedits into a single file ?
Sergey Tkachenko
Site Admin
Posts: 17561
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

As a single document or as several documents?
If as a single document, you need to add documents from all these richviewedits in one richview and save it.

Code: Select all

procedure AddDoc(source, dest: TCustomRichView); 
var Stream: TMemoryStream; 
begin 
  Stream := TMemoryStream.Create;
  source.SaveRVFToStream(Stream, False);
  Stream.Position := 0;
  dest.InsertRVFFromStream(Stream, dest.ItemCount); 
  Stream.Free; 
end; 

  ... 

  RichView1.Clear; 
  RichView1.DeleteUnusedStyles(True, True, True); 
  AddDoc(SourceRV1, RichView1); 
  AddDoc(SourceRV2, RichView1); 
  AddDoc(SourceRV3, RichView1); 
  RichView1.SaveRVF('All.rvf')
If you need to save them as separate documents, you need to do it yourself (or use some database)
Post Reply