I have this docx file loaded in my code:
byte[] documentBytes = File.ReadAllBytes("C:\\mydocument.docx");
This document contains the word "foo" in either the main body, header or footer, what is the easiest way to check for the existence of the word "foo"?
Using OpenXML Powertools:
The variables
headerCount,footerCountandbodyCountrepresent the number of hits for your regex per part of the document. TheMainDocumentPartproperty also contains properties for images, charts, themes etc.