Using trial version 19.2. I have both RTF and RVF set to save and load DocParameters in their respective options.
Problem: I have a test RTF file. When I save it, I'm doing this:
RichViewEdit1.DocParameters.Comments := Memo1.Text;
RichViewEdit1.SaveRTF(ExtractFilePath(Application.ExeName) + 'test.rtf',false);
RichViewEdit1.DocParameters.Comments := '';
When I load it, I do this:
RichViewEdit1.ClearAll;
RichViewEdit1.DeleteUnusedStyles(true,true,true);
RichViewEdit1.LoadRTF(ExtractFilePath(Application.ExeName) + 'test.rtf');
Memo1.Text := RichViewEdit1.DocParameters.Comments;
DocParameters.Comments are always empty after saving RTF from my test app. If I check the file in Word after saving it from my test app, it also shows Comments as empty. If, however, I add a comment to the test file in Word, and then load it in my test app, the comment shows up. But if I save from my app again the comment is wiped out.
RVF is working as expected with the same basic code.
Any ideas on what is wrong? Thanks!
RTF not saving DocParameters.Comments
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: RTF not saving DocParameters.Comments
Assign
RichViewEdit1.RTFReadProperties.ReadDocParameters := True;
RichViewEdit1.RTFReadProperties.ReadDocParameters := True;
Re: RTF not saving DocParameters.Comments
Yes, it is already set that way. Both that and rvrtfSaveDocParameters are set to true.Sergey Tkachenko wrote: ↑Wed Jul 07, 2021 9:31 am Assign
RichViewEdit1.RTFReadProperties.ReadDocParameters := True;
Reading a file with a comment in it works. So, if I open my test.rtf in Word, add a comment and save it, then open it in the RichViewEdit in my app, I do see the comment, but only if I added the comment using Word.
Saving it from the RichViewEdit does not work. If I add a comment when I save the test.rtf from my app, the comment is empty afterward. It's the saving a comment part of it that is not working for me. It does work in RVF format, but not rtf. When saving the rtf I'm using:
Code: Select all
RichViewEdit1.DocParameters.Comments := Memo1.Text; //memo1 has text in it
RichViewEdit1.SaveRTF(ExtractFilePath(Application.ExeName) + 'test.rtf',false);
RichViewEdit1.DocParameters.Comments := '';
Hope that helps.
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: RTF not saving DocParameters.Comments
I confirm the bug: Author, Title, and Comments are saved in RTF correctly only if they contain non-English characters.
I fixed it in my working version, this fix will be included in the next update.
I fixed it in my working version, this fix will be included in the next update.
Re: RTF not saving DocParameters.Comments
Thanks Sergey.Sergey Tkachenko wrote: ↑Thu Jul 08, 2021 4:01 pm I confirm the bug: Author, Title, and Comments are saved in RTF correctly only if they contain non-English characters.
I fixed it in my working version, this fix will be included in the next update.