procedure TForm1.Button1Click(Sender: TObject);
var
ss: TStringStream;
const
CR: Byte = 13;
LF: Byte = 10;
begin
ss := TStringStream.Create;
try
ss.LoadFromFile('c:\Temp\Document.rtf');
Memo1.Lines.Text := ss.DataString;
// RichViewEdit1.LoadRTF('c:\Temp\Document.rtf'); // Does not show text
ss.Position := 0;
// RichViewEdit1.UseStyleTemplates := False;
RichViewEdit1.LoadRTFFromStream(ss); // Does not show text
// RichView1.LoadRTFFromStream(ss); // does not work either
finally
ss.Free;
end;
end;
1 LoadRTF and LoadRTFFromStream are fast viewer-style methods (see http://www.trichview.com/help/viewer_vs_editor.html), it does not prepare document for displaying. You need to call Format method to display the document.
2 LoadRTF and LoadRTFFromStream add content to the end of existing document. So call Clear before.