Hi
Thanks for your request. Please try using the following code:
Document doc = new Document(@"Test161\in.doc");
//Loop through all section in document
foreach (Section section in doc.Sections)
{
ArrayList hfList = new ArrayList();
//Loop through HeaderFooter nodes
foreach (HeaderFooter hf in section.HeadersFooters)
{
//Remove Primary footer (as an example)
if (hf.HeaderFooterType == HeaderFooterType.FooterPrimary)
hfList.Add(hf);
}
//Remove headerfooters
foreach (HeaderFooter hf in hfList)
{
hf.Remove();
}
}
//Save output document
doc.Save(@"Test161\out.doc");
Hope this helps.
Best regards.
Alexey Noskov
Developer/Technical Support
Aspose Auckland Team