loading...

How to check if requirement sets are supported by your add-in's Office host

dev365 profile image Dev365 ・1 min read

using Office.context.requirements.isSetSupported, It is possible to programmatically check if requirement sets are supported by your add-in's Office host.
if the Office host doesn't support the requirement set, isSetSupported returns false

The following code shows the usage of isSetSupported method.

if (Office.context.requirements.isSetSupported(RequirementSetName, MinimumVersion)) {
}
Enter fullscreen mode Exit fullscreen mode

Example

if (Office.context.requirements.isSetSupported('WordApi', '1.1'))
{
    // Run code that provides additional functionality using the Word JavaScript API when the add-in runs in Word 2016 or later.
}
Enter fullscreen mode Exit fullscreen mode

Discussion

pic
Editor guide