0

enter image description hereI'm using Office.js to display a dialog in an Office add-in. I call the displayDialogAsync function like this:

Office.context.ui.displayDialogAsync(`https://localhost:3000/notification.htmlmessage=${message}&icon=${icon}`,{ height: 10, width: 10, displayInIframe: true },function (asyncResult) {
dialog = asyncResult.value;
dialog.addEventHandler(Office.EventType.DialogMessageReceived, processDialogAlertMessage);});

However, the dialog that appears takes up more space than I specified in the displayDialogAsync options. It looks like it occupies 20% of the parent window height and 50% of the parent window width, even though I set both height and width to 10.

Why is the dialog taking up more space than specified, and how can I fix this issue to make the dialog appear with the intended dimensions?

Sam Diaz
  • 51
  • 4

2 Answers2

1

The height property defines the height of the dialog as a percentage of the current display. Defaults to 80%. But the 250px is the minimum height value.

The width property defines the width of the dialog as a percentage of the current display. Defaults to 80%. But the 150px is the minimum width value.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
0

Because there is a security requirement of Office that the dialog must present the major part of the add-in's URL in the title bar, minimum width option cannot be satisficed in your scenario.

Kejing Peng
  • 171
  • 4