Mega Code Archive

 
Categories / Delphi / Forms
 

How to get the Rtf formating from a RichEdit

Title: How to get the Rtf formating from a RichEdit function GetRTFText(ARichEdit: TRichedit): string; var ss: TStringStream; emptystr: string; begin emptystr := ''; ss := TStringStream.Create(emptystr); try ARichEdit.PlainText := False; ARichEdit.Lines.SaveToStream(ss); Result := ss.DataString; finally ss.Free end; end; procedure TForm1.Button1Click(Sender: TObject); begin Memo1.Text := GetRTFText(RichEdit1); end;