I am trying to use the SFF_PLAINRTF constant with EM_STREAMIN message. If I
understand the documentation right, it *should* strip out RTF formatting
when I read the RTF. At least that is how I interpret it.
This is exactly what I'm trying to do - get down to plainText. Yes I know
there is a plainText property of a RichEdit control, but in my case I
cannot use it - it is a long story...
Here's how I am calling it:
sendMessage(aRichEditHandle, EM_STREAMIN, SF_RTF or SFF_PLAINRTF,
longint(@editstream));
My EditStream callback was cloned from the Delphi source (D7). The problem
is that adding SFF_PLAINRTF does nothing, or at least not what I want it to
do. Does anyone have an experience using it and can clarify what exactly it
does?
More generally, given a bunch of RTF text, what is the most efficient way
to convert this to plain text (remove all formatting)?
regards,
-randall sell
> I am trying to use the SFF_PLAINRTF constant with EM_STREAMIN
> message. If I understand the documentation right, it *should* strip out
> RTF formatting when I read the RTF. At least that is how I interpret it.
SFF_PLAINRTF strips out *language-specific* RTF tags, but it does not strip
out RTF altogether.
> This is exactly what I'm trying to do - get down to plainText.
Then you should be loading plain-text data to begin with.
> More generally, given a bunch of RTF text, what is the most efficient
> way to convert this to plain text (remove all formatting)?
One way is to first load the RTF normally (no SFF_PLAINRTF flag), and then
read the RichEdit's Text property (or issue a WM_GETTEXT message directly),
which will strip off all formatting.
Gambit