function GetRTF(RE: TRichedit): string;
var
strStream: TStringStream;
begin
strStream := TStringStream.Create('') ;
try
RE.PlainText := False;
RE.Lines.SaveToStream(strStream) ;
Result := strStream.DataString;
finally
strStream.Free
end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
RichEdit1.Lines.LoadFromFile('e:\123.rtf');
Memo1.Text := GetRTF(RichEdit1);
end;

 

procedure TForm1.Button2Click(Sender: TObject);
begin
RichEdit1.Lines.LoadFromFile('e:\123.rtf');
Memo1.Lines.Assign(RichEdit1.Lines);
end;

 

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-02-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案