Headings not being preserved

Hi,

Normally I have no problem at all with headings being preserved in Aspose.Words - heading 1 comes out as H1 etc. But on this document in particular, none of the heading styles are being outputted as H1, H2 etc when the document is run through Aspose.Words. Instead, they’re outputted as regular paragraphs.

I’m not sure what’s different about this document compared to previous ones. Can someone possibly shed some light on why it’s happening? I don’t know if it’s the way the document has been created (although it looks fine to me) or if it’s an issue in the Aspose software.

Thanks in advance.
Laura.

Hello Laura!
Thank you for your inquiry.
Please see the following HTML snippet:
Cambria’; font-size:16pt; font-weight:bold; ">Introduction

ACTION PROGRAMME
“Introduction” has “Heading 1” style in the source document and output as
to HTML. The next heading “ACTION PROGRAMME” has “Style1” style. So this is not a heading from MS Word point of view and output as simple paragraph
.
Some headings that should be output as h1…h6 really appear as paragraphs. I found that your document has unaccepted revisions. You can call Document.AcceptAllRevisions before conversion and they will become headings:
https://reference.aspose.com/words/net/aspose.words/document/acceptallrevisions/
Table 1 – Employment Land Allocations
To join spans with equal formatting you can also call Document.JoinRunsWithSameFormatting:
https://reference.aspose.com/words/net/aspose.words/document/joinrunswithsameformatting/
Please let me know if this helps.
Regards,

Aha! I suspected it was an issue with the document but wasn’t sure what. I will give Document.AcceptAllRevisions a try.

Thank you so much!

Laura.