Insert in a single file the contents of varios richviewedits
Insert in a single file the contents of varios richviewedits
How can i assign the contents of varios richviewedits into a single file ?
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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.
If you need to save them as separate documents, you need to do it yourself (or use some database)
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')