I still don’t understand whether there is a header:
For testing purposes, I have two documents, the first ww. Docx, with no headers or footers at all,
This second document hh.Docx has a header, but the header is linked to the previous section.
In both cases, the document header returns null, The same returns result makes it impossible for me to distinguish between no header and with header, but the header links to the previous section.
Aspose.Words.Document docc = new Aspose.Words.Document(“c:\ww.docx”); Aspose.Words.Document doch = new Aspose.Words.Document(“c:hh.docx”);
this is Screenshot of test code results.
the first ww. Docx, with no headers or footers at all,
docc.Sections[1].HeadersFooters[HeaderFooterType.HeaderPrimary] is null
docc.Sections[1].HeadersFooters[HeaderFooterType.HeaderFirst] is null
This second document hh.Docx has a header, but the header is linked to the previous section.
doch.Sections[1].HeadersFooters[HeaderFooterType.HeaderPrimary] is null
doch.Sections[1].HeadersFooters[HeaderFooterType.HeaderFirst] is null
Attached(Screenshot.docx) is a screenshot of the test resultshh.docx (18.2 KB)
ww.docx (11.9 KB)
Screenshot.docx (72.0 KB)