0
有一個用於在OneNote中獲取墨跡筆劃對象的API。根據示例/ documentation,您可以運行獲取InkStroke對象的代碼。我的理解是,熒光筆筆畫是OneNote對象模型中的FloatingInk。是否有可能獲得關於中風本身的信息?例如:OneNote InkStroke/FloatingInk API
if(inkObject.getType() == "Highlighter") {
var width = inkObject.getStroke().width;
var height = inkObject.getStroke().height;
}
該文檔顯示了下面的示例,但它似乎只是使「id」屬性可用。
OneNote.run(function(context) {
// Gets the active page.
var page = context.application.getActivePage();
var contents = page.contents;
// Load page contents and their types.
page.load('contents/type');
return context.sync()
.then(function(){
// Load every ink content.
$.each(contents.items, function(i, content) {
if (content.type == "Ink"){
content.load('ink/id');
}
})
return context.sync();
})
.then(function(){
// Log ID of every ink content.
$.each(contents.items, function(i, content) {
if (content.type == "Ink"){
console.log(content.ink.id);
}
})
});
})
.catch(function(error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
新增的UserVoice –
請求你將如何從加載項獲得RestApiId? –
Here:https://stackoverflow.com/questions/44753454/getrestapiid-function-in-objects-from-office-js-for-onenote –