I have some rtf stored in a database. At times, I only need the text and not the rft formatting. Here's the approach I tried to convert the rtf to plain text:
sText := ''; // class level public variable to contain the text
sText := [Get rtf from database];
// I have verified that sText at this point contains the expected rtf text
if bPlainText then begin
rtfEdit := TRichEdit.Create(nil);
ss := TStringStream.Create;
// ***** WHEN EXECUTING, FOLLOWING LINE CAUSES ERROR *****
sText := rtfEdit.Text;
Does it matter here that the rtf is not divided into lines but is just a blob of rtf? If so how do I load it correctly?
Actual error message: EInvalidOperation: TPopupList Control has no parent window.
I'm not sure if this message is actually a result of this error or the result of something that fails later because of the failure here. Thanks in advance for your help.