@@ -4,13 +4,11 @@ uid: 'office!Office.UI:interface'
4
4
package : office!
5
5
fullName : Office.UI
6
6
summary : >-
7
- Provides objects and methods that you can use to create and manipulate UI components, such as dialog boxes, in your
8
- Office Add-ins.
7
+ Provides objects and methods to create and manipulate UI components, such as dialog boxes, in your Office Add-ins.
9
8
10
9
11
- Visit "[Use the Dialog API in your Office
12
- Add-ins](https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins)<!-- -->" for more
13
- information.
10
+ For guidance on how to configure dialog boxes, see [Use the Dialog API in your Office
11
+ Add-ins](https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins)<!-- -->.
14
12
remarks : |-
15
13
16
14
@@ -210,62 +208,31 @@ methods:
210
208
365](https://learn.microsoft.com/office/dev/add-ins/develop/unified-manifest-overview)<!-- -->.
211
209
212
210
213
- The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial
214
- page loads, you can go to other domains.
215
-
216
-
217
- Any page calling `Office.context.ui.messageParent` must also be on the same domain as the parent page.
218
-
219
-
220
- **Design considerations**:
221
-
222
-
223
- The following design considerations apply to dialog boxes.
224
-
225
-
226
- - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the
227
- same time from Add-in Commands (custom ribbon buttons or menu items).
228
-
229
-
230
- - Every dialog box can be moved and resized by the user.
211
+ **Important**:
231
212
232
213
233
- - Every dialog box is centered on the screen when opened.
234
-
235
-
236
- - Dialog boxes appear on top of the application and in the order in which they were created.
237
-
238
-
239
- Use a dialog box to:
240
-
241
-
242
- - Display authentication pages to collect user credentials.
243
-
244
-
245
- - Display an error/progress/input screen from a ShowTaskpane or ExecuteAction command.
214
+ - The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial
215
+ page loads, you can go to other domains.
246
216
247
217
248
- - Temporarily increase the surface area that a user has available to complete a task .
218
+ - Any page calling `Office.context.ui.messageParent` must also be on the same domain as the parent page .
249
219
250
220
251
- Do not use a dialog box to interact with a document. Use a task pane instead.
221
+ - To learn about rules, limitations, and best practices for the Office Dialog API, see [Best practices and rules
222
+ for the Office dialog API](https://learn.microsoft.com/office/dev/add-ins/develop/dialog-best-practices)<!-- -->.
252
223
253
224
254
- **displayDialogAsync Errors**
225
+ - For information on errors and how to handle them, see [Handle errors and events in the Office dialog
226
+ box](https://learn.microsoft.com/office/dev/add-ins/develop/dialog-handle-errors-events)<!-- -->.
255
227
256
228
257
- <table> <tr> <th>Code number</th> <th>Meaning</th> </tr> <tr> <td>12004</td> <td>The domain of the URL passed to
258
- displayDialogAsync isn't trusted. The domain must be either the same domain as the host page (including protocol
259
- and port number), or it must be registered in the <code>AppDomains</code> section of the add-in manifest.</td>
260
- </tr> <tr> <td>12005</td> <td>The URL passed to displayDialogAsync uses the HTTP protocol. HTTPS is required. (In
261
- some versions of Office, the error message returned with 12005 is the same one returned for 12004.)</td> </tr>
262
- <tr> <td>12007</td> <td>A dialog box is already opened from the task pane. A task pane add-in can only have one
263
- dialog box open at a time.</td> </tr> <tr> <td>12009</td> <td>The user chose to ignore the dialog box. This error
264
- can occur in online versions of Office, where users may choose not to allow an add-in to present a dialog.</td>
265
- </tr> </table>
229
+ - In Outlook on the web and new Outlook on Windows, don't set the
230
+ [window.name](https://developer.mozilla.org/docs/Web/API/Window/name) property when configuring a dialog in your
231
+ add-in. The `window.name` property is used by these Outlook clients to maintain functionality across page
232
+ redirects.
266
233
267
234
268
- In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult
235
+ - In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult
269
236
object to return the following information.
270
237
271
238
@@ -365,62 +332,31 @@ methods:
365
332
365](https://learn.microsoft.com/office/dev/add-ins/develop/unified-manifest-overview)<!-- -->.
366
333
367
334
368
- The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial
369
- page loads, you can go to other domains.
335
+ **Important**:
370
336
371
337
372
- Any page calling `Office.context.ui.messageParent` must also be on the same domain as the parent page.
373
-
374
-
375
- **Design considerations**:
376
-
377
-
378
- The following design considerations apply to dialog boxes.
379
-
380
-
381
- - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the
382
- same time from Add-in Commands (custom ribbon buttons or menu items).
383
-
384
-
385
- - Every dialog box can be moved and resized by the user.
386
-
387
-
388
- - Every dialog box is centered on the screen when opened.
389
-
390
-
391
- - Dialog boxes appear on top of the application and in the order in which they were created.
392
-
393
-
394
- Use a dialog box to:
395
-
396
-
397
- - Display authentication pages to collect user credentials.
398
-
399
-
400
- - Display an error/progress/input screen from a ShowTaskpane or ExecuteAction command.
338
+ - The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial
339
+ page loads, you can go to other domains.
401
340
402
341
403
- - Temporarily increase the surface area that a user has available to complete a task .
342
+ - Any page calling `Office.context.ui.messageParent` must also be on the same domain as the parent page .
404
343
405
344
406
- Do not use a dialog box to interact with a document. Use a task pane instead.
345
+ - To learn about rules, limitations, and best practices for the Office Dialog API, see [Best practices and rules
346
+ for the Office dialog API](https://learn.microsoft.com/office/dev/add-ins/develop/dialog-best-practices)<!-- -->.
407
347
408
348
409
- **displayDialogAsync Errors**
349
+ - For information on errors and how to handle them, see [Handle errors and events in the Office dialog
350
+ box](https://learn.microsoft.com/office/dev/add-ins/develop/dialog-handle-errors-events)<!-- -->.
410
351
411
352
412
- <table> <tr> <th>Code number</th> <th>Meaning</th> </tr> <tr> <td>12004</td> <td>The domain of the URL passed to
413
- displayDialogAsync isn't trusted. The domain must be either the same domain as the host page (including protocol
414
- and port number), or it must be registered in the <code>AppDomains</code> section of the add-in manifest.</td>
415
- </tr> <tr> <td>12005</td> <td>The URL passed to displayDialogAsync uses the HTTP protocol. HTTPS is required. (In
416
- some versions of Office, the error message returned with 12005 is the same one returned for 12004.)</td> </tr>
417
- <tr> <td>12007</td> <td>A dialog box is already opened from the task pane. A task pane add-in can only have one
418
- dialog box open at a time.</td> </tr> <tr> <td>12009</td> <td>The user chose to ignore the dialog box. This error
419
- can occur in online versions of Office, where users may choose not to allow an add-in to present a dialog.</td>
420
- </tr> </table>
353
+ - In Outlook on the web and new Outlook on Windows, don't set the
354
+ [window.name](https://developer.mozilla.org/docs/Web/API/Window/name) property when configuring a dialog in your
355
+ add-in. The `window.name` property is used by these Outlook clients to maintain functionality across page
356
+ redirects.
421
357
422
358
423
- In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult
359
+ - In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult
424
360
object to return the following information.
425
361
426
362
@@ -533,7 +469,9 @@ methods:
533
469
content : ' openBrowserWindow(url: string): void;'
534
470
parameters :
535
471
- id : url
536
- description : ' The full URL to be opened including protocol (e.g., https), and port number, if any.'
472
+ description : >-
473
+ The full URL to be opened including protocol (http or https), and port number, if any. Other protocols like
474
+ mailto aren't supported.
537
475
type : string
538
476
return :
539
477
type : void
0 commit comments