问题
I'm developing a new Outlook Add-In that uses displayDialogAsync to do authentication. We have several different client verions. It works fine on Outlook for Mac 2016 and Office 365 ProPlus Click-To-Run Version 1808 on Windows. But on Office 2016 ProPlus MSI Version (MSO 16.0.4549.1000) for windows, it gives the error "Permission Denied".
Dialog API requirements sets page at https://docs.microsoft.com/en-us/office/dev/add-ins/reference/requirement-sets/dialog-api-requirement-sets says for Office 2016 or later on Windows (one-time purchase) with Build 16.0.4390.1000 or later, it should work. Our build version is clearly later but we still get that error.
I have also verified that this is not due to the AppDomains in manifest. I have added the domain that I'm trying to open in the dialog to the AppDomains.
回答1:
When an API is unavailable in Outlook Desktop, it can return the "Permission Denied" error, which is the wrong error message. In this case, it just means that the API is not available.
Since your Outlook version is above 4390, this reason for this is likely because the displayDialog API also requires an updated version of OSF Client DLLs. When Office updates are applied through Microsoft Update, all of the Office DLLs should be updated together automatically. In cases where updates are manually applied, some Office DLLs may not be included in the update. If a user intentionally wants to apply updates individually, this page lists the latest Office 2016 update files (look for the osfclient-x-none update, which contains the DLLs needed for the displayDialog API).
In your add-in, there are also two things you can do to detect this case. First, we recommend using the Office.context.requirements.isSetSupported API to check that "Mailbox" requirement set 1.4 is supported by the Outlook client (this is the Outlook requirement set that contains the displayDialog API). This checks that everything needed for the API to run is available.
If your add-in requires the API, you can avoid adding conditionals within the add-in by updating the minimum requirement set supported in the add-in manifest. This means the add-in won't be available in Outlook clients that don't support that requirement set.
来源:https://stackoverflow.com/questions/56451242/outlook-add-in-on-2016-proplus-msi-version-mso-16-0-4549-1000-gives-permissio