0
我得到每當我試圖讓款辦公應用程序的列表屬性以下錯誤:如何獲得列表樣式的段落在辦公室JS API
{
"name": "OfficeExtension.Error",
"code": "ItemNotFound",
"message": "We couldn’ t find the item you requested. Check the OfficeExtension.Error.debugInfo for more information.",
"traceMessages": [],
"innerError": null,
"debugInfo": {
"code": "ItemNotFound ",
"message": "We couldn’ t find the item you requested.Check the OfficeExtension.Error.debugInfo for more information.",
"errorLocation ": "Paragraph._onAccess "
}
}
這裏是我使用的代碼:
var paragraphs = context.document.body.paragraphs;
context.load(paragraphs, 'style');
return context.sync().then(function() {
var list = paragraphs.items[0].listOrNullObject;
context.load(list);
return context.sync().then(function() {
var item = list.levelTypes;
return context.sync().then(function() {
console.log("text" + item);
});
})
如何獲取段的列表樣式?
我運行在只有word.run上下文有關的代碼,並能夠訪問properties.Problem我面臨的只有相關的屬性訪問列表的段落,我得到了上述錯誤。我在在線辦公室365進行測試。 – user1461826