Richedit from RTF to Plain Text HELP

From: JR (jorenders_at_hotmail.com)
Date: 08/31/04


Date: 31 Aug 2004 08:48:13 -0700

Normally richedit can convert a file from rtf to plain text
but because some reason it's still keeps a rtf:
I'have also tried to give the stream to the richedit
but with the same result.

        MemStream := TMemoryStream.Create;
        RTFtoPlainText := TRichEdit.Create(Form);
        RTFtoPlainText.Parent := Form;
        MapiMessage.SaveMessageTextToStream(MemStream,True);
        memStream.SaveToFile(GC_TempPath + '\mailbody.rtf');
        RTFtoPlainText.PlainText := True;
        RTFtoPlainText.Lines.LoadFromFile(GC_TempPath +
'\mailbody.rtf');
        DeleteFile(GC_TempPath + '\mailbody.rtf');
        RTFtoPlainText.Lines.SaveToFile('c:\result.txt');
        MemStream.Free;

Example of mailbody.rtf

{\rtf1\ansi\deff0\deftab720\fromtext{\fonttbl{\f0\fswiss MS Sans
Serif;}{\f1\fnil Symbol;}{\f2\fswiss\fcharset0 Arial;}}
{\colortbl\red0\green0\blue0;}
\pard\plain\f2\fs20 982821841128\par
ScanId\par
26/08/2004 15:46 \par
\par
\par
\par
\par
\par
}

Example of the result (is the same):

{\rtf1\ansi\deff0\deftab720\fromtext{\fonttbl{\f0\fswiss MS Sans
Serif;}{\f1\fnil Symbol;}{\f2\fswiss\fcharset0 Arial;}}
{\colortbl\red0\green0\blue0;}
\pard\plain\f2\fs20 982821841128\par
ScanId\par
26/08/2004 15:46 \par
\par
\par
\par
\par
\par
}

Does anybody know what my fault is?

Thank you.