Search code examples
macosoutlook-web-addins

how to show google page in dialog using displayDialogAsync(startAddress, options, callback) API in outlook add-in


When I use below code to open a google page from outlook add-in, it opens in default browser instead of a dialog .

Office.context.ui.displayDialogAsync('https://www.ggogle.com', {height: 30, width: 20, displayInIframe: true},
            function (asyncResult) {
                dialog = asyncResult.value;
                dialog.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogMessageReceived, receiveMessage);
                dialog.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogEventReceived, dialogClosed);
                //event.completed({allowEvent: true}) 
            }
        );

How can I open it in an dialog


Solution

  • If the url you are opening (https://google.com) is not defined in the AppDomain element in the manifest, it will open in the default browser. To open in a display dialog, add the url to the AppDomains element.