Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.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
Javascript 使用Office JS word API从对话框访问word文档上下文_Javascript_Office365_Office Js_Office365api_Office365 Apps - Fatal编程技术网

Javascript 使用Office JS word API从对话框访问word文档上下文

Javascript 使用Office JS word API从对话框访问word文档上下文,javascript,office365,office-js,office365api,office365-apps,Javascript,Office365,Office Js,Office365api,Office365 Apps,我试图通过对话框访问word文档上下文,如下所示: Office.context.document.setSelectedDataAsync(“Hello World!”), 函数(异步结果){ var error=asyncResult.error; if(asyncResult.status==Office.AsyncResultStatus.Failed){ 写入(error.name+:“+error.message); } });您不能通过对话框与文档交互 从文件中: messag

我试图通过对话框访问word文档上下文,如下所示:

Office.context.document.setSelectedDataAsync(“Hello World!”),
函数(异步结果){
var error=asyncResult.error;
if(asyncResult.status==Office.AsyncResultStatus.Failed){
写入(error.name+:“+error.message);
}

});您不能通过对话框与文档交互

从文件中:

messageParent函数是对话框中仅有的两个可以调用的Office API之一。(另一个是Office.context.requirements.isSetSupported)

因此,基本上,您可以通过对话框显示/收集一些数据,并通过
messageParent
函数将其发送回父级


您可以向用户显示所有选项,然后将所选选项发送回父窗口,然后在父窗口中根据需要与文档交互。

您不能通过对话框与文档交互

从文件中:

messageParent函数是对话框中仅有的两个可以调用的Office API之一。(另一个是Office.context.requirements.isSetSupported)

因此,基本上,您可以通过对话框显示/收集一些数据,并通过
messageParent
函数将其发送回父级


您可以向用户显示所有选项,然后将所选选项发送回父窗口,然后在父窗口中根据需要与文档交互。

我几乎认为我必须这样实现它,这是一个很好的建议!我几乎以为我会像那样实施它,好建议!