2017-05-31 49 views
2

當我嘗試啓動加載項的聖言在線,它讓我看到以下內容:在Word在線不支持動作

{ 
    "name": "OfficeExtension.Error", 
    "code": "NotAllowed", 
    "message": "The action isn’t supported in Word Online. Check the OfficeExtension.Error.debugInfo for more information.", 
    "traceMessages ": [], 
    "innerError ": null, 
    "debugInfo ": { 
     "code ": "NotAllowed ", 
     "message ": "The action isn’t supported in Word Online. Check the OfficeExtension.Error.debugInfo for more information.", 
     "errorLocation ": "Range.delete " 
    } 
} 

下面是代碼:

Word.run(function (context) { 

    // Getting current selection  
    var range = context.document.getSelection(); 
    range.delete(); 
    range.insertHtml(text, TEXT_REPLACE); 

    return context.sync().then(function() { 

    }); 

}).catch(function (error) { 
    handleError(error); 
}); 

根據Office Add-In documentation它應該由Word Online支持

+0

嗨,任何人都可以幫助我嗎? –

+0

對此有何評論?我不知道該怎麼辦。它只是不起作用。 Range.delete和Range.insertHtml不起作用。基於官方文檔,應該在Word API v1.1(https://dev.office.com/reference/add-ins/word/range)中支持。 這裏是從我的manifest.xml的片段: <要求> <設定DefaultMinVersion = 「1.1」> \t \t <集名稱= 「WordApi」 MINVERSION = 「1.1」/> \t ReadWriteDocument 我在做什麼錯? –

回答

0

這在Word Online中受支持。也就是說,確保你的清單指定ReadWriteDocument爲你的加載項的permissions

+0

我在清單文件中有這個。它仍然不起作用 –