trichview.com

trichview.support




Nonvisual convert HTML to RTF


Return to index


Author

Message

David Kroll

Posted: 10/14/2003 0:04:26


I need to take some html from a received email and convert it to rtf to save

in my database, but this needs to be done non-visually.  I'm trying the

below, but I get an "EInvalidOperation - 'Control' has no parent window"

error.  Any suggestions?


      rve := TRichViewEdit.Create(nil);

      style := TRVStyle.Create(nil);

      rve.Style := style;

      try

        importer := TrvHTMLImporter.Create(nil);

        try

          importer.RichView := rve;

          importer.LoadHtml(HTMLText);

        finally

          importer.Free;

        end;

        rtfStream := TStringStream.Create('');

        try

          rve.SaveRTFToStream(rtfStream, False);

          result.Text := rtfStream.DataString;

        finally

          rtfStream.Free;

        end;

      finally

        style.Free;

        rve.Free;

      end;





Powered by ABC Amber Outlook Express Converter