0
votes

I am developing word office add-in.I need to load word javascript API based on microsoft version available. example:-If office version is 2016 i need to load Word API version 1.1 If it is 2019 i need to load Word API 1.2 As of now i am checking whether current office version supporting Word API 1.1 or not.

if (!Office.context.requirements.isSetSupported('WordApi', '1.1')) {
            showNotification("Error!", "This version not supported");
            return;
        }

But i need to load as per above criteria. can some one please help me.

1

1 Answers

1
votes

You cannot load distinct versions of requirement sets like WordApi 1.1. And you don't need to. Each version is a superset of the preceding versions. Use isSetSupported to test for WordApi 1.3 (the latest version). If it is supported, your add-in can call any Word API in 1.1, 1.2, and 1.3. If 1.3 is not supported, your code can branch to an alternate experience that only uses APIs in 1.2 or 1.1.

You could also test for 1.2 and, if it is not supported, branch to an alternate experience that uses only 1.1 APIs.