I have about 400 files in .docx format, and I need to determine the length of each in #pages.
So, I want to write C# code for selecting the folder that contains the
use DocumentFormat.OpenXml.dll you can find dll in C:\Program Files\Open XML SDK\V2.0\lib
Sample code:
DocumentFormat.OpenXml.Packaging.WordprocessingDocument doc = DocumentFormat.OpenXml.Packaging.WordprocessingDocument.Open(docxPath, false);
MessageBox.Show(doc.ExtendedFilePropertiesPart.Properties.Pages.InnerText.ToString());
to use DocumentFormat.OpenXml.Packaging.WordprocessingDocument class you need to add following references in your project
DocumentFormat.OpenXml.dll & Windowsbase.dll