Search code examples
javascriptoutlookoffice365office-jsoutlook-web-addins

I want to skip showing the message when calling Office.context.ui.displayDialogAsync() method


I'm coding an Outlook Add-in.

I want to show a dialog message by using displayDialogAsync().

But when I use the method, the confirmation message is shown, before displaying a dialog (I attached a screenshot).

Are there any solutions for skipping this message?

screen shot : the message when a code calls displayDialogAsync()

・reference

https://dev.office.com/docs/add-ins/develop/dialog-api-in-office-add-ins

    function openWindow()
    {
        var startAddress = 'https://localhost:44303/AppCompose/Sample/Sample.html';
        Office.context.ui.displayDialogAsync(startAddress);
    }

Solution

  • The message is necessary to prevent pop-up blockers. So no, there is no way to skip it if you use pop-up mode. However, if your page supports iframing you can pass the displayAsIframe=true parameter (see documentation); this mode doesn't show the extra confirmation because it is displayed as a floating div with an Iframe (as opposed to a new window).

    Important: I see you are using the API in Office Online. Please be aware that we have not yet officially updated our documentation and samples to state that it's supported so you might see some bumps along the way. I expect everything will be in place by early next year.