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

Free Support Forum - aspose.com

How to check a document has header or not using aspose words

Hi,
I wanted to find out whether a word document has header or not using aspose.words
Could you please help me on this.
Thanks,
Ramakrishna

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. In this case you can check HeadersFooters.Count. Please see the following code:

Document doc = new Document("in.doc");

if (doc.FirstSection.HeadersFooters.Count != 0)

Console.WriteLine("This document has header/footer");

else

Console.WriteLine("This document has not any header/footer");

Best regards,

Thanks AndreyN, this worked out. thanks a lot.

Cheers,
Ramakrishna