Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SFF_PLAINRTF

0 views
Skip to first unread message

Randall Sell

unread,
Jan 29, 2006, 9:33:30 PM1/29/06
to
G'day all,

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

Remy Lebeau (TeamB)

unread,
Jan 30, 2006, 3:10:56 AM1/30/06
to

"Randall Sell" <ran...@bytewise.nospam.com.au> wrote in message
news:43dd79e7$1...@newsgroups.borland.com...

> 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


0 new messages