I have a Richedit that allows my users to format and view error messages that display within my application.
I now need to be able to export the text only (no formatting) out to another database that their trouble-ticket system uses.
I have tried all the combinations of PlainText I can think of and I always still get the rtf formatting.
How can I get the text only?
Answering the direct question that you asked, the Text
property is precisely what you are looking for. For some reason it doesn't show up in the TRichEdit
documentation, but it is inherited from TCustomEdit
.
It sounds to me (following comments to Andreas' answer) as though what you really need to do it as follows:
RichEdit.LoadFromStream
passing that stream, making sure PlainText
is False
.RichEdit.Text
to get the unformatted text.At the moment you are simply putting the RTF into the control as plain text. You need to put it into the control as rich text, and for that you need LoadFromStream
.