Una posible implementación sería algo como:
procedure TForm1.Button1Click(Sender: TObject);
var
rtfEdit: TRichEdit;
strLine: String;
nLoop : Integer;
begin
rtfEdit := TRichEdit.Create(Nil);
rtfEdit.Parent := Self;
try
rtfEdit.Lines.LoadFromFile('c:\MyRTF_File.rtf');
nLoop := 0;
While nLoop < rtfEdit.Lines.Count do
begin
strLine := rtfEdit.Lines[nLoop];
//... Haz algo con la linea actual disponible en "strLine".
//...
Inc( nLoop );
end;
finally
rtfEdit.Free;
end;
end;
|