chetankotwal's avatar
chetankotwal
Brass Contributor
Sep 11, 2023
Status:
New

How to get current page number and the total page count of a document using Word Add-in office.js

I would like to inquire if there is a method or feature available in Office.js for programmatically obtaining the current page number and the total page count of a document. Specifically, I am interested in accessing this information within the Microsoft Word application.

Additionally, if such a feature is not currently available, do you have any plans or information regarding the potential release of this feature in the future? It's worth noting that our organization does not use OneDrive for any operations.

Here are the details of my environment:

Platform: PC desktop
Host Application: Microsoft Word
Office Version: Microsoft Word for Microsoft 365 MSO (Version 2304 Build 16.0.16327.20200) 64-bit
Operating System: Windows 10 Pro
Thank you for your assistance.

  • Page API is supported through this desktop only requirement set. Please note that Word online doesn't have this support. 

     

    https://learn.microsoft.com/en-us/javascript/api/requirement-sets/word/word-api-desktop-1.2-requirement-set?view=word-js-preview

     

  • hano_e's avatar
    hano_e
    Copper Contributor

    Yeah, it was possible in VBA. This is one of blocker to my migration.