We're sorry Aspose doesn't work properply without JavaScript enabled.

# Is it possible to remove the Footer alone and retain the Header

Team,
We are using Aspose.Word (for Java).

I am using the following code to remove the Header and the Footer.

Document doc = new Document(oInputStream);
for (int i = 0; i < doc.getSections().getCount(); i++)
{
}


Is it possible to remove only the Footer and retain the Header. If so please point to the right code that does it.

Thanks,
Nimalan

Hi
Thanks for your inquiry. Yes of course you can remove only footers from the document. Please see the following code example:

Document doc = new Document("C:\\Temp\\in.doc");
for (int i = 0; i < doc.getSections().getCount(); i++)
{
// Loop through all headers/footers
{
{
hf.remove();
}
}
}
// save document
doc.save("C:\\Temp\\out.doc");


Hope this helps.
Best regards.

Thank you. That works.

Nimalan