Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OfficeJs - How to display modal dialog

I am using OfficeJs to create word add-in. In that i want to show modal dialog on click on ribbon button. I have used below API

Office.context.ui.displayDialogAsync(url, {height: 30, width: 20}); to display dialog but it is non-modal dialog. Is there any API to display modal dialog using officeJS.

like image 853
pooja Avatar asked Oct 26 '25 00:10

pooja


1 Answers

Office.js doesn't provide any other method for displaying dialogs. From MSDN:

The following design considerations apply to dialog boxes:

  • An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the same time from Add-in Commands (custom ribbon buttons or menu items).
  • Every dialog box can be moved and resized by the user.
  • Every dialog box is centered on the screen when opened.
  • Dialog boxes appear on top of the host application and in the order in which they were created.

Use a dialog box to:

  • Display authentication pages to collect user credentials.
  • Display an error/progress/input screen from a ShowTaskpane or ExecuteAction command.
  • Temporarily increase the surface area that a user has available to complete a task.
like image 87
Eugene Astafiev Avatar answered Oct 28 '25 04:10

Eugene Astafiev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!