Some heading styles are missing after saved as .docx

General TRichView support forum. Please post your questions here
Post Reply
edwinyzh
Posts: 104
Joined: Sun Jun 05, 2022 2:22 pm

Some heading styles are missing after saved as .docx

Post 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
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

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

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

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

Post 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.
edwinyzh
Posts: 104
Joined: Sun Jun 05, 2022 2:22 pm

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

Post by edwinyzh »

So according to discussion here the issue's solved :)
Post Reply