Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Office365 如何在office.js for excel加载项中添加对话框_Office365_Office Js_Office Addins_Excel Addins - Fatal编程技术网

Office365 如何在office.js for excel加载项中添加对话框

Office365 如何在office.js for excel加载项中添加对话框,office365,office-js,office-addins,excel-addins,Office365,Office Js,Office Addins,Excel Addins,当用户单击taskpane中的按钮时,应在excel中打开一个新对话框,重定向到特定链接。我尝试了很多次,但没有看到结果或错误。让我知道我应该编辑哪些文件 例如: 请向我们展示您调用对话API.Office.context.ui.displayDialogAsync('url',{height:30,width:20})的代码;我必须编辑清单文件中的任何内容吗?函数openDialog(){//调用打开对话框Office.context.ui.displayDialogAsync(“,{he

当用户单击taskpane中的按钮时,应在excel中打开一个新对话框,重定向到特定链接。我尝试了很多次,但没有看到结果或错误。让我知道我应该编辑哪些文件

例如:


请向我们展示您调用对话API.Office.context.ui.displayDialogAsync('url',{height:30,width:20})的代码;我必须编辑清单文件中的任何内容吗?函数openDialog(){//调用打开对话框Office.context.ui.displayDialogAsync(“,{height:45,width:55});}的Office通用API。您需要提供更多。提供调用displayDialogAsync并显示错误处理的整个函数。如果是外部url,则必须将其添加到清单IIRC中。
function openDialog() {
  Office.context.ui.displayDialogAsync(
    'https://localhost:3000/popup.html',
    {height: 45, width: 55},

    function (result) {
      dialog = result.value;
      dialog.addEventHandler(Office.EventType.DialogMessageReceived, 
        processMessage);
  }
);
}

function processMessage(arg) {
  document.getElementById("user-name").innerHTML = arg.message;
  dialog.close();
}