How to remove footer line in word document

Hi All,

Please provide the codes lines for removing the footer line in existing document.

Thanks in advance,
Rambabu




1 Reply

BP Bhuvaneswari P Syncfusion Team November 25, 2008 08:53 AM UTC

Hi Rambabu,

Thank you for your interest in Syncfusion products.

Please use the below code snippet to remove the footer from the existing document.

WordDocument document = new WordDocument(@"..\..\Doc1.doc");
HeaderFooter footer= document.Sections[0].HeadersFooters.Footer;
for (int i = 0; i < footer.ChildEntities.Count; i++)
footer.ChildEntities.RemoveAt(0);
document.Save("sample.doc");
System.Diagnostics.Process.Start("sample.doc");


Please try this code and let us know if this helps you.

Best Regards,
Bhuvana



Loader.
Up arrow icon