Hi
I'm trying to save and load the RTFtext of a TWPRichEdit component to a string field in a database.
Converting to a string value works great using: wp.AsANSIString('RTF')
To re-load the value, I try the following which doesn't work. Can someone please help?
var
RTFText: TWPRTFBlobContents;
wpnew: TWPRTFEngineBasis;
begin
with self.Create(AOwner) do begin //create the form
try
//method 1 - from a colleague who examined the source code
wpNew := TWPRTFEngineBasis.Create(self);
RTFText := TWPRTFBlobContents.Create(wpNew);
RTFText.AsString := LetterText;
wp.RTFText := RTFText; //wp is the TWPRichEdit control on the form
// or //
// method 2 - from me using code from the support forums
wp.AsString := LetterText; //string field containg RTF text
wp.RTFText.update;
RTFText.Free;
wpNew.free;
ShowModal;
finally
free;
end;
end;