Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
What is this page about?
This page explains how to remove headers and footers using different approaches.
Word.Document doc = Application.Documents.Open("Add Headers and Footers.doc");
Globals.ThisAddIn.Application.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Paragraphs.Last.Range.Delete();
Globals.ThisAddIn.Application.ActiveDocument.Sections[1].Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Paragraphs.Last.Range.Delete();
Document doc = new Document("Remove Headers and Footers.doc");
foreach (Section section in doc)
{
section.HeadersFooters.RemoveAt(0);
HeaderFooter footer;
// Primary footer is the footer used for odd pages.
footer = section.HeadersFooters[HeaderFooterType.FooterPrimary];
if (footer != null)
footer.Remove();
}
doc.Save("Remove Headers and Footers.doc");
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.