我正在開發一個使用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中?如果沒有,是否有計劃支持此功能?
任何輸入或澄清將不勝感激!謝謝!