none
Office.context.ui.displayDialogAsync message probelm RRS feed

  • Question

  • I am trying to build a word 365 addin with a Login using Office.context.ui.displayDialogAsync API

    I open a new dialog and login via azure ad (login.microsoftonline.com)

    since ogin.microsoftonline.com I must use a dialog not in IFrame (displayInIframe: false)

    But when i do this I dont seem to get any masseges from the dialog back to my page

    This is only when i use online version of word, when using the addin in my installed word 2016 it seems to work 

    I am running my webapp from localhost, can that be a problem for messaging?

    code to open 

     var dialogUrl = 'https://localhost:44303/Addin/login'

     Office.context.ui.displayDialogAsync(dialogUrl, { width: 25, height: 60, displayInIframe: true }, function (asyncResult) {
                        if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
                            document.getElementById("demo").textContent = "Failed";
                            
                        }

                        document.getElementById("demo").textContent = "Start";
                        // Get the dialog and register event handlers.
                        var dialog = asyncResult.value;
                        dialog.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogMessageReceived, function (asyncResult) {
                           
                            document.getElementById("demo").textContent = "message";
                            // We got our data, time to close the dialog.
                            dialog.close();
                        });

                        dialog.addEventHandler(Microsoft.Office.EventType.DialogEventReceived, function (asyncResult) {
                            
                            document.getElementById("demo").textContent = "event";
                            // We got our data, time to close the dialog.
                            dialog.close();
                        });
                    });

    Friday, January 26, 2018 12:30 PM

All replies

  • Hello Magado,

    It seems that you are using a custom html. Could you please share it to us so we could try to use it to reproduce your issue? 

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 29, 2018 10:14 AM