Free Support Forum - aspose.com

Reading Header

Is there a code sample of how to read the Header of a .doc file without using the DocumentVisitor?

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

Thanks for your inquiry. Yes, of course you can read Header/Footer without DocumentVisitor. Header/Footer is child of Section so you can access to this node using the following code:

doc.Sections[0].HeadersFooters[HeaderFooterType.HeaderPrimary]

Hope this helps.

Best regards.