¿Has probado este código?
Código Delphi
[-]
Var
RtfInvisible: TRichEdit;
Begin
TrichEdit.Create(RtfInvisible);
Try
RtfInvisible.PlainText:=False;
(1º) Esto falla, puesto que la construcción es incorrecta; No se exactamente lo que querías hacer, pero lo que has hecho no está bien. En la última línea la variable RtfInvisible está sin asignar.
(2º) Por otro lado, me da la impresión de que al liberar la variable (valor devuelto), posiblemente estés provocando que otras partes del código que utilizan el objeto devuelto estén fallando al acceder a algo que ya has liberado.
Código Delphi
[-]
result:=RtfInvisible.lines;
Finally
if Assigned(RtfInvisible) then RtfInvisible.Free;
end;
Creo que deberías corregirlo y añadir al menos un comentario con el texto correcto.