ExtendedFilePropertiesPart.Properties.Pages.Text returns incorrect value. RRS feed

  • Question

  • Hi

    I am trying to get the page count of a .docx file. There are 70 pages in the file. I have written below code for this.

    WordprocessingDocument ccDocument = WordprocessingDocument.Open("C:\\MC_11943.docx", false);
    int ccDocPageCount = Convert.ToInt32(ccDocument.ExtendedFilePropertiesPart.Properties.Pages.Text);

    The above code always return 3 as the page count.

    1. Is there any way to make "ExtendedFilePropertiesPart.Properties.Pages.Text" return correct value?
    2. Is there an alternate way to get page count (using Open xml sdk or anything other than interop dll)?


    Thursday, May 3, 2012 4:41 AM