We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

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.
Live Chat Icon For mobile
Up arrow icon