Depending on size and situation it may reside as a encrypted file or in a blob-field.
I don't use dataset though. I do this:
var MemoryStream: TMemoryStream;begin MemoryStream := TMemoryStream.Create; try WPRichText1.SaveToStream(MemoryStream); MemoryStream.Seek(0,soFromBeginning); result := aDokumentData.SaveFromStream(MemoryStream); finally MemoryStream.Free; end;
Save from stream determines where to put data
We have discovered that the problem only occurs when creating new documents. We can make 1-n fields bold but when we save it's ignored. When editing the document, adding bold-fields, it saves correctly.
When I tried what you suggested, I found out that I had nowhere to put that code-snippet. We use a TWPToolBar
I'll reuse this post. Found out that my colleague added his parallel piece of code to handle those shortcuts:
if (Key = Integer('B')) and (Shift = [ssctrl]) then
begin
WPRichText1.TextCursor.CurrAttribute.ToggleCharstyle(WPSTY_BOLD);
Key := 0;
end
else if (Key = Integer('I')) and (Shift = [ssctrl]) then
begin
WPRichText1.TextCursor.CurrAttribute.ToggleCharstyle(WPSTY_ITALIC);
Key := 0;
end
else if (Key = Integer('U')) and (Shift = [ssctrl]) then
begin
WPRichText1.TextCursor.CurrAttribute.ToggleCharstyle(WPSTY_UNDERLINE);
Key := 0;
end;
I'd better try to remove the redundancy here. Somehow call the button or find a shared TAction somewhere.
I have added .Changing to the OnCharacterAttrChange. I'll go on testing.