Page 1 of 1

Insert in a single file the contents of varios richviewedits

Posted: Fri Sep 08, 2006 1:21 am
by VT
How can i assign the contents of varios richviewedits into a single file ?

Posted: Fri Sep 08, 2006 6:43 pm
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)