I used this Microsoft tutorial to build a WORD add-in in VS2017
. The add-in works as expected. Then, for a test, I dded a button btnTest
in Home.html
file's task pane markup. The btnTest
calls the following function in Home.js
. When you click the btnTest
button in task pane the first line of the code (now commented out) opens the specified url in a browser but the second line does nothing. How can I make displayDialogAsync(…) work here? I'm using Office 2016 desktop version
:
function MyTestMethod() {
//window.open('http://localhost:50900/home.html');
Office.context.ui.displayDialogAsync('http://localhost:50900/home.html');
}