unit funciones; interface function RtfToText(const Cadena: PChar): PChar; cdecl; export; implementation uses Windows, Forms, Classes, SysUtils, StdCtrls, ComCtrls; function RtfToText(const Cadena: PChar): PChar; var RTFConverter: TRichEdit; MyStringStream: TStringStream; begin RTFConverter := TRichEdit.CreateParented(HWND_MESSAGE); try MyStringStream := TStringStream.Create(Cadena); try RTFConverter.Lines.LoadFromStream(MyStringStream); RTFConverter.PlainText := True; RTFConverter.WantReturns := False; RTFConverter.WordWrap := False; RTFConverter.Lines.StrictDelimiter := True; RTFConverter.Lines.Delimiter := #13; Result := PChar(RTFConverter.Lines.Text); finally MyStringStream.Free; end; finally RTFConverter.Free; end; end; end.