Unable to open a dialog with a ribbon button

108 Views Asked by At

We have an Outlook web addin with a ribbon button defined in the manifest.

                            <Control xsi:type="Button" id="msgComposeSettingsButton">
                                <Label resid="funcComposeButtonLabel2" />
                                <Supertip>
                                    <Title resid="funcComposeSuperTipTitle2" />
                                    <Description resid="funcComposeSuperTipDescription2" />
                                </Supertip>
                                <Icon>
                                    <bt:Image size="16" resid="settings-16" />
                                    <bt:Image size="32" resid="settings-32" />
                                    <bt:Image size="80" resid="settings-80" />
                                </Icon>
                                <Action xsi:type="ExecuteFunction">
                                    <FunctionName>loadSettings</FunctionName>
                                </Action>
                            </Control>

The loadSettings function is defined in the function file that is also defined in the manifest. The loadSettings function calls the displayDialogAsync method from the Office Api.

Office.context.ui.displayDialogAsync(
    options.url,
    options.dialogOptions,
    function (asyncResult) {
        if (asyncResult.status === Office.AsyncResultStatus.Failed) {
            let errorMessage = null;

            log('ERROR', asyncResult.error);

            // In addition to general system errors, there are 3 specific errors for
            // displayDialogAsync that you can handle individually.
            switch (asyncResult.error.code) {
            case 12004:
                errorMessage = 'Domain is not trusted';
                break;
            case 12005:
                errorMessage = 'HTTPS is required';
                break;
            case 12007:
                errorMessage = 'A dialog is already opened.';
                break;
            default:
                errorMessage = asyncResult.error.message;
                break;
            }

            log('ERROR', errorMessage);
        }
        else {
            _dialog = asyncResult.value;
            _dialog.addEventHandler(Office.EventType.DialogMessageReceived, handleDialogMessageEvent);
            _dialog.addEventHandler(Office.EventType.DialogEventReceived, eventReceivedHandler);
        }
    }
);

The dialog renders and opens fine in every platform tested (Outlook for Windows and OWA (IE, Firefox, Chrome)) except for a select few on Outlook for Mac. Why does the dialog work as expected for most on Outlook for Mac, but not for a select few?

0

There are 0 best solutions below