Tips (1541)
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;
Rate this tip: