Я обычно создаю API oNeNote, когда смотрю на этот сайт (https://learn.microsoft.com/ja-jp/javas ... ote-js-1.1), но у меня проблемы с copytonotebook (). Указано. Какой еще код я должен использовать, чтобы получить такое же поведение? < /p>
Заранее.async function deleteInfo() {
await OneNote.run(async (context) => {
const app = context.application;
// Gets the active Notebook.
const notebook = app.getActiveNotebook();
// Gets the active Section.
const section = app.getActiveSection();
let newSection;
await context.sync();
try {
const newSection = section.copyToNotebook(notebook);
newSection.load('id');
await context.sync();
console.log(newSection.id);
} catch (copyError) {
console.error(copyError);
if (copyError.debugInfo) {
console.error("Debug Info:", JSON.stringify(copyError.debugInfo, null, 2));
}
if (copyError.innerError) {
console.error("Inner Error:", JSON.stringify(copyError.innerError, null, 2));
}
}
});
}
< /code>
ошибка < /p>
Debug Info: {
"code": "InvalidArgument",
"message": "InvalidArgument",
"errorLocation": "Section.copyToNotebook",
"statement": "var copyToNotebook = v.copyToNotebook(...);",
"surroundingStatements": [
"var v = context.root._getObjectByReferenceId(\"{70f32172-415d-4679-abad-71d6bbbacf0b}{13}\");",
"var v1 = context.root._getObjectByReferenceId(\"{70f32172-415d-4679-abad-71d6bbbacf0b}{12}\");",
"// >>>>>",
"var copyToNotebook = v.copyToNotebook(...);",
"//
Подробнее здесь: https://stackoverflow.com/questions/795 ... script-api