Reputation: 40140
I can't post a working demo, because the code needs to run in MS Outlook.
I am developing based on this Outlook Add-in Command Demo.
I want to add a dialog box, as shown here in the MS docs.
I took that working demo and added one single line:
Office.context.ui.displayDialogAsync('https://my_site.com/project/hello_world.html');
where https://my_site.com/project
is where the rest of the app is, and hello_world.html
is a bare minimal HTML file with a "Hello World" body.
I added that where I saw Office.context
being used - in the function insertText()
- to be sure that it had ben created.
That function is caled when a button on a task pane is clicked when composing an email.
I do not see the "Hello World" dialog, nor anything in the console log.
Is displayDialogAsync()
not allowed from a task pane?
Any ideas from the info I can give what I might be doing wrongly, or how to detect it? Does the fucntion have a return value, or throw an exception if it fails? Any othe ideas? Is there a minimal demo, maybe just from clicking a button on the ribbon?
Upvotes: 1
Views: 1837
Reputation: 9674
You can call displayDialogAsync
from a task pane. To troubleshoot, pass a callback parameter to the method and read the AsyncResult.error
property. For details see Office.ui as well as the article that you linked to.
Upvotes: 1