我正在开发一个使用ContentControl.insertText的Office.js的Word加载项。根据该文档,此方法由Office Online中支持的WordApi requirement set 1.1提供。此外,ContentControls的文档将Office Online列为受支持,并且在涉及到使用该特定方法时没有提及任何例外。Word Online应支持通过ContentControl.insertText插入文本到内容控件中吗?
这就是说,当我运行在本机Word 2016年加载,一切正常,但是当我在Word中在线环境中运行它,它失败,出现以下异常:
code:"NotAllowed"
errorLocation:"ContentControl.insertText"
message:"The action isn’t supported in Word Online. Check the OfficeExtension.Error.debugInfo for more information."
仅供参考,我使用它像这样:
control.insertText(heading.Text, 'Replace');
我也尝试运行文档中提供的示例中,具有相同的结果:它工作在Word 2016年,但未能在Word在线上述例外。
有没有人能够成功地将文本插入到Office Online环境中的ContentControl中?如果没有,是否有计划支持此功能?
任何输入或澄清将不胜感激!谢谢!