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
Textproperty is precisely what you are looking for. For some reason it doesn’t show up in theTRichEditdocumentation, but it is inherited fromTCustomEdit.It sounds to me (following comments to Andreas’ answer) as though what you really need to do it as follows:
RichEdit.LoadFromStreampassing that stream, making surePlainTextisFalse.RichEdit.Textto 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.