none
The field NUMPAGES is 1 less than expected RRS feed

Answers

  • Hi Dave, since we resolved your issue offline I am posting the details of the problem resolution here for the benefit of the community.

    NUMPAGES is expected to always return the total number of pages in the document. According to ISO/IEC 29500-1, section 17.6.12, it describes the value of the NUMPAGES field as "Retrieves the number of pages in the current document, as recorded in the Pages element of the Application-Defined File Properties part." However, it appears that Word is behaving differently and the value that is returned by the NUMPAGES field can vary and is affected by the pgNumType element's start value. There may be other factors involved as well and a request has been filed to document this behavior in MS-OI29500. 



    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Wednesday, March 2, 2016 8:35 PM
    Moderator

All replies

  • Hi David,
    Thank you for this inquiry. One of our engineers will look into this and follow-up soon.
    Regards,
    Edgar
    Monday, February 1, 2016 4:04 PM
    Moderator
  • Hi Dave, I am the engineer who will be working with you on this issue. I am currently researching the problem and will provide you with an update soon. Thank you for your patience.

    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Monday, February 1, 2016 9:01 PM
    Moderator
  • Hi;

    Any luck on this? We have a customer asking us about it.

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Wednesday, February 10, 2016 6:58 PM
  • Hi Dave, I am still looking into this issue. I hope to have more information for you soon. Your patience is greatly appreciated.

    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Wednesday, February 10, 2016 8:54 PM
    Moderator
  • Hi Dave, it looks like the problem is in the first sectPr element that has all of the headerReference and footerReference elements. Take a look at the highlighted line below.

     

    <w:sectPr w:rsidR="00476A58" w:rsidSect="00513C05">

       <w:headerReference w:type="even" r:id="rId8"/>

       <w:headerReference w:type="default" r:id="rId9"/>

       <w:footerReference w:type="even" r:id="rId10"/>

       <w:footerReference w:type="default" r:id="rId11"/>

       <w:headerReference w:type="first" r:id="rId12"/>

       <w:footerReference w:type="first" r:id="rId13"/>

       <w:type w:val="continuous"/>

       <w:pgSz w:w="12240" w:h="15840"/>

       <w:pgMar w:top="720" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="432" w:gutter="0"/>

       <w:pgNumType w:start="0"/>

       <w:cols w:space="720"/>

       <w:titlePg/>

       <w:docGrid w:linePitch="360"/>

    </w:sectPr>

     

    It counts the pages starting with 0 which results in the pages being numbered and counted as 0, 1, 2, 3 instead of 1, 2, 3, 4. If you change the start value to 1 it will fix the page numbering and count problem in the footer. Details on the pgNumType element can be found in the ISO/IEC 29500-1 document in section 17.6.12.

     

    Please let me know if you have any other questions.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Thursday, February 11, 2016 10:23 PM
    Moderator
  • Hi Josh;

    I don't think that's it. I originally tried that - take a look at PageNumbers.docx. It has that same setting, but it shows as page 1 of 4, 2 of 4, & 3 of 4.

    ??? - thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Tuesday, February 16, 2016 6:23 PM
  • Hi Dave, I just tested this again from scratch and the pages are numbered correctly when I view the document. Here is the process I followed.

     

    1. Downloaded the file from the link provided.
    2. Change the file to a .zip extension and extract the document.xml.
    3. Change the pgNumType start attribute from 0 to 1.
      1. Also verified that there are no other instances of the pgNumType element in the file.
    4. Overwrite document.xml file in the .zip package and rename it back to .docx.
    5. Open the file in Word.
    6. The second, third and fourth pages are numbered 2 of 4, 3 of 4, and 4 of 4 respectively.

     

    Which version of Word are you using to view the file? I am using Word 2016 build 16.0.6568.2015, which should be the latest publically available release.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Tuesday, February 16, 2016 7:11 PM
    Moderator
  • Hi Josh;

    Same for me. But if you look at  PhyStandardizedFormat_ABedits.docx you'll see that it does "of 3" even though there are 4 pages. So the NUMPAGES field has a total that is not the number of pages.

    It's the NUMPAGES field that's acting unexpectedly.

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Tuesday, February 16, 2016 7:13 PM
  • When I click on that link and it opens the document in the Word web app I see that as well. So, is the issue that the web app doesn't display it properly? Does it look right if you open it in the desktop application?

    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Tuesday, February 16, 2016 7:18 PM
    Moderator
  • I only use the desktop app - Word 2013. And I see it there.

    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing


    • Edited by DavidThi808 Saturday, April 16, 2016 8:29 PM
    Tuesday, February 16, 2016 7:20 PM
  • Hi Dave, do you mean Word 2013?

    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Tuesday, February 16, 2016 7:56 PM
    Moderator
  • OOPS - sorry yes. Word 2013.

    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Tuesday, February 16, 2016 10:06 PM
  • Hi Dave, I just tested this using Word 2013, build 15.0.4569.1506 (SP1), and it looked correct. At this point I'm wondering if the file is getting modified by Word 2016 when I save it from the link that you provided. Would you be able to send the original file to me at dochelp(at)microsoft.com?

     

    Thanks.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Wednesday, February 17, 2016 6:31 PM
    Moderator
  • Hi Dave, since we resolved your issue offline I am posting the details of the problem resolution here for the benefit of the community.

    NUMPAGES is expected to always return the total number of pages in the document. According to ISO/IEC 29500-1, section 17.6.12, it describes the value of the NUMPAGES field as "Retrieves the number of pages in the current document, as recorded in the Pages element of the Application-Defined File Properties part." However, it appears that Word is behaving differently and the value that is returned by the NUMPAGES field can vary and is affected by the pgNumType element's start value. There may be other factors involved as well and a request has been filed to document this behavior in MS-OI29500. 



    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Wednesday, March 2, 2016 8:35 PM
    Moderator
  • Hi Josh;

    Have they documented the behavior for NUMPAGES yet?

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Saturday, April 16, 2016 8:30 PM