How to transfer a model to Office 365 Dialog from Word 2016?

I played with the Office 365 add-in for MS word. I have a dialogue to manipulate the selected word. I need to pass this image (possibly Base64 value) into my dialog so that I can play with the image before replacing back to the word (in the same place).

I use the code below to show a popup:

Office.context.ui.displayDialogAsync("https://" + location.host + "/Views/ImageManager.html", { width: 64, height: 55, requireHTTPS: true }, function (asyncResult) {
    dialog = asyncResult.value;
    dialog.addEventHandler(Office.EventType.DialogMessageReceived, processMessage);
    if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
        return;
    }
});

The thing I wanted to do?

When the user selects any image to play with him in the word document and clicks the ribbon button to open this dialog box, I need to transfer this image to the dialog box that will be displayed in the dialog box.

How to transfer image model in a dialog box?

+4
1

:

  • URL-, displayDialogAsync()
  • window.localStorage script script .

UPDATE: Office Dev User Voice : https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/suggestions/17196659-improve-custom-dialog p >

+1

Source: https://habr.com/ru/post/1671332/


All Articles