Office.js provides no way to detect unsupported APIs within supported requirement sets
Problem Statement
Currently, the only documented mechanism to check for annotations support is Office.context.requirements.isSetSupported('WordApi', '1.8').
However, on perpetual / non-subscription Office builds (e.g., Office 2021, Office 2024, LTSC), isSetSupported('WordApi', '1.8') evaluates to true, yet calling document.getAnnotations() immediately throws a runtime error (NotImplemented / GeneralException).
There is currently zero way for an add-in to detect whether the user is on a perpetual build or whether getAnnotations() will fail before actually calling it.
Why This Is Unacceptable
- Broken API Contract: isSetSupported() is advertised as the canonical capability-detection mechanism. Gating individual functions behind license tiers while marking the entire requirement set as "supported" defeats the purpose of requirement sets and leads to false positives.
- Impossible to Build Resilient UI: Add-ins cannot hide, disable, or adapt UI elements conditionally on startup because there is no API to check if getAnnotations (or the underlying license tier) is supported.
- No Viable Pre-Check: Developers cannot safely query capabilities upfront. Relying on blind runtime failures (try/catch on first invocation) produces broken user experiences, unneeded error telemetry, and brittle add-in logic.
Required Solution
Office.js must provide a reliable, deterministic way to detect whether an individual API or feature is usable before invoking it.
We need Microsoft to implement at least one of the following:
- Method / Feature-Level Detection: Provide a granular capability check, for example:
- Office.context.requirements.isMethodSupported('Word.Document.getAnnotations') -> boolean
- or Word.isFeatureSupported('Annotations') -> boolean
- License / SKU Awareness: Expose host license properties on the context object so add-ins can identify perpetual/non-subscription environments upfront, for example:
- Office.context.license.isSubscription -> boolean
- or Office.context.license.skuType -> 'perpetual' | 'subscription'
Reference
GitHub Issue: https://github.com/OfficeDev/office-js/issues/5701