Page 1 of 1

Some heading styles are missing after saved as .docx

Posted: Thu Jun 16, 2022 2:55 pm
by edwinyzh
See the screenshot below, it's a .docx file saved from TRichViewEdit.

The original document has Heading 1...3. The strange thing is that, the Word document look good, but Word 365 lists only Heading 1 and Heading 2 in the Styles panel, but not Heading 3.

But if you reload the .docx file to TRichViewEdit with ActionTestUni.exe, you can click 'Section 11' and you can see Heading 3 is there.

I'm sending you the .docx file to your email. I don't have the original .xml richview file yet since it's generated on-the-fly. If you need it please let me know.

Image

Re: Some heading styles are missing after saved as .docx

Posted: Thu Jun 16, 2022 5:36 pm
by Sergey Tkachenko
I am sorry, but I do not understand why MS Word displays it in this way.
All styles exist in this document.

You can see it yourself.

1. If you apply “Heading 2” in MS Word, you will see that “Heading 3” appears in the ribbon gallery. If you apply “Heading 3”, “Heading 4” appears there.
2. Click the bottom right button in “Styles” group on MS Word ribbon. You will see “Styles” panel. On this panel, click “Options” button, and choose “Select styles to show” = “All styles”. You will see all heading styles.

I checked this DocX file inside, and I cannot find any difference between how “Heading 2” and “Heading 3” are saved.

Re: Some heading styles are missing after saved as .docx

Posted: Thu Jun 16, 2022 7:21 pm
by Sergey Tkachenko
It looks like I understand why it happens.
Starting from "Heading 3", MS Word displays "Heading N" in the list only if "Heading N-2" is used in the document
(similarly to TRVStyleTemplateComboBox with SmartHeadings = True).

But in this document, headings are applied only to character attributes, not to paragraph, so MS Word does not count them as used.

Re: Some heading styles are missing after saved as .docx

Posted: Sun Jun 19, 2022 8:16 am
by edwinyzh
So according to discussion here the issue's solved :)