Header's Footer's automatically created with LinkToPrevious method

While create documents using “LinkToPrevious” methods, it adds 6 footer/header automatically. Please check the below for further reference.


1) Create a word document using .Net aspose dll

Document wordDoc = new Document();

2) Create a section
wordDoc.Sections.Clear();
Section currentSection = new Section(wordDoc);
wordDoc.Sections.Add(currentSection);

3) Just set LinkToPrevious to false

currentSection.HeadersFooters.LinkToPrevious(false);

4) Just check the count for “currentSection.HeadersFooters” its 6, how???

Please let me know for further reference.

Hi Sridhar,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 16.1.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-13245. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,
Hi Sridhar,

Regarding WORDSNET-13245, our product team has completed the work on your issue and has come to a conclusion that this issue and the undesired behavior you're observing is actually not a bug. So, we will close this issue as 'Not a Bug'.

The HeaderFooterCollection.LinkToPrevious method links or unlinks all headers and footers to the corresponding headers and footers in the previous section. If any of the headers or footers do not exist, it creates them automatically. So this is the expected behavior.

So after calling this method you will get 6 headers/footers:

  • HeaderFooterType.HeaderPrimary,
  • HeaderFooterType.HeaderFirst,
  • HeaderFooterType.HeaderEven,
  • HeaderFooterType.FooterPrimary,
  • HeaderFooterType.FooterFirst,
  • HeaderFooterType.FooterEven.

Best regards,