Word Object model Section, Body, etc


I am looking at your Aspose Word Object model as per this page

Then I created a very simple word document (test.docx)

This test.docx has a header with 2 textboxes and some text inside.
I also added an image in the header.
Then I created a couple of pages.

When I look at the model in debug I am confused.
I see
- Section
- HeaderFooter (I see 6 nodes like but only 2nd node is populated with info)
- Body
- Paragraphs

My confusion is why do I see 6 HeaderFooter objects?
Any why the 2nd HeaderFooter object is the only one filled with some data.


Please note that Section can have one Body and maximum one HeaderFooter of each HeaderFooterType. Body and HeaderFooter nodes can be in any order inside Section.

HeaderFooter is a section-level node and can only be a child of Section. So, it is possible that one section can has three headers and three footers.

Please ZIP and attach your input Word document here for our reference. We will then provide you more information on it.

Sorry I cannot upload a .docx document as I am not authorized.
can you please authorize me?



The forum does not allow to upload DOCX/DOC file. Please ZIP and attach your Word document.

ok i c.
pls find attached zip file.
RefDoc.zip (35.2 KB)


The primary header of document contains some content. So, it is available on all pages of document. Please note that a valid document may has following header types for each section.

  • HeaderEven : This header type is used for even numbered pages e.g. if you want to show some text on pages 2, 4, 6, and so on. You can insert content in this header type.
  • HeaderPrimary : The content of this header type is shown on odd numbered pages.
  • HeaderFirst : If you want to show some different content in the first page of section, you can use this header type. You need to set PageSetup.DifferentFirstPageHeaderFooter property to true for first header type.

You can set PageSetup.OddAndEvenPagesHeaderFooter property to true if you want to show different headers and footers for odd-numbered and even-numbered page.

Similarly, you can use FooterEven, FooterPrimary, and FooterFirst footer types in your document.

thank you for the info.

one more question…
re. Sections.
So far I only see one section in my docs.
In what scenario will there be more than one section in a document?


It depends on your requirement. In MS Word document, you can insert section breaks. Please check the attached image for detail. Section Break.png (20.2 KB)

E.g. If you want different page orientation (portrait or landscape) in Word document, you can insert sections in your document.

ok great thank you very much.
I understand now.