Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/442.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 Word Online Office JS-文本框内的内容控件_Javascript_Office Js - Fatal编程技术网

Javascript Word Online Office JS-文本框内的内容控件

Javascript Word Online Office JS-文本框内的内容控件,javascript,office-js,Javascript,Office Js,我们使用文本框将内容控件定位在正常文本流之外的场景中,包括文档页眉/页脚和正文中 但在Word Online上运行时,我们无法对这些内容控件执行操作,因为在运行以下操作时,文本框中的内容控件不属于返回的项数组: await Word.run(async (context) => { let contentControls = context.document.contentControls; contentControls.load(); await conte

我们使用文本框将内容控件定位在正常文本流之外的场景中,包括文档页眉/页脚和正文中

但在Word Online上运行时,我们无法对这些内容控件执行操作,因为在运行以下操作时,文本框中的内容控件不属于返回的
数组:

await Word.run(async (context) => {
    let contentControls = context.document.contentControls;

    contentControls.load();

    await context.sync();

    for (let i = 0; i < contentControls.items.length; i++) {
        let cc = contentControls.items[i];
        // cc will never be the Content Control within the Text Box <- Problem!!
    }

    await context.sync();
});
等待Word.run(异步(上下文)=>{
让contentControls=context.document.contentControls;
contentControls.load();
wait context.sync();
for(设i=0;i//cc永远不会成为文本框内的内容控件这是设计上的,因为Word online不支持文本框,也不支持文本框内的所有内容。正如您所见,文本框在联机时呈现为图片,我们无法解析和操作其中的内容。

缺少这种支持使得Word online在某些情况下无法使用我们的场景。我们外接程序的用户不会理解为什么我们的外接程序在Word Online上的工作方式与在Word 2016中的不同。您知道文本框(或者更确切地说,文本框中的内容控件)何时工作吗将在Word Online上得到支持?在线文本框中的文本框已在待办事项中,但到目前为止没有时间承诺。@JuanBalmori关于这个问题有什么消息吗?