If anybody can help, that would be great.
Just to say that the Win 95 and Win 98 have the most recent version of
microsoft common controls installed.
how is it not working?
Mike Orriss (TeamB and DevExpress)
"Mike Orriss (TeamB)" <m...@3kcc.co.uk> wrote in message
news:VA.000024c0.06139005@pcmike1...
Thanks.
"Mike Orriss (TeamB)" <m...@3kcc.co.uk> wrote in message
news:VA.000024c0.06139005@pcmike1...
Well, it has always worked for me on Win98/NT/W2K.
If you set a richedits Plaintext property to true and then stream the LInes
property to memory or filestream you get the plain text. If you assign the
richedits Text property to a string you get the plain text. The only situation
under which this would yield the RTF text is when you have loaded a RTF file
via Lines.LoadFromFile or stream and PlainText was already true. In that case
the RTF would be treated as plain text.
> If anybody can help, that would be great.
We cannot help you if you don't show us the code you are using.
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.
Here is the code I've been using, the RTF is passed as the parameter
'aString' and the ASCII text is returned.
RichEdit is a TRichEdit.
Thanks.
function
TTKNotesObjectRichEditForms.ConvertRTFToAsciiText(aString:string):string;
var
varString:string;
begin
RichEdit1.Text:='';
Richedit1.PlainText := FALSE;
RichEdit1.Text := aString;
Richedit1.PlainText := TRUE;
varString:=RichEdit1.Text;
Result := String(varString);
end;
That does not do what you expect it to do. The Plaintext property is
*only* relevant for the richedit.lines.Loadfrom* and SaveTo* methods,
nowhere else. So what you do is storing the rich text as plain text into
the control, including all formatting characters. The way to go is this:
function
TTKNotesObjectRichEditForms.ConvertRTFToAsciiText(aString:string):string;
var
ss:tstringstream;
begin
ss:= TStringstream.Create( aString );
try
Richedit1.PlainText := FALSE;
Richedit1.Lines.LoadFromStream( ss );
finally
ss.free
end;
Result := RichEdit1.Text;
end;
Michael