Forum Discussion
Word on the web: support section PageSetup in Office.js
Hi rogergrambihler, you're reading the situation correctly — this is a gap in the API surface rather than something wrong in your code.
Per Microsoft Learn's Word JavaScript API requirement sets documentation, Section.pageSetup sits in the WordApiDesktop 1.3 requirement set, and that set is listed as not applicable to Office on the web. The web side is covered by the cross-platform WordApi sets (WordApi 1.1 through 1.9) plus WordApiOnline 1.1, so there is currently no supported Office.js call that returns a section's page setup in Word on the web.
For an add-in that has to run on both, the practical approach is to test for the capability at runtime with Office.context.requirements.isSetSupported('WordApiDesktop', '1.3') and only call section.pageSetup when it reports true. On the web you then fall back to the OOXML routes you already described, accepting their trade-offs: getFileAsync with the compressed document always carries the real section properties but means fetching and parsing the whole file, and getOoxml gives you the sectPr for a section except for the final section, where Word on the web returns defaults.
Since this is a parity request rather than a bug, the route that actually moves it is the Microsoft 365 feedback channel. I would log it there with your four scenarios, especially the compliance stamping and court-filing pre-flight cases, because those show why a workaround that only reads stale or partial data is not enough.