我尝试浏览文档,但未能找到有关访问 Office 365 文档的自定义属性的任何信息。我希望能够访问这些属性,以便从我的 Office 365 插件对它们执行某些操作。
我找到了这个方法 但它似乎只返回文件Url
我尝试浏览文档,但未能找到有关访问 Office 365 文档的自定义属性的任何信息。我希望能够访问这些属性,以便从我的 Office 365 插件对它们执行某些操作。
我找到了这个方法 但它似乎只返回文件Url
是的,你可以使用customProperties
,这是Excel.CustomPropertyCollection
类
这是一个示例代码:
await Excel.run(async (context) => {
let docProperties = context.workbook.properties;
docProperties.load(
"author, lastAuthor, revisionNumber, title, subject, keywords, comments, category, manager, company, creationDate"
);
await context.sync();
console.log("Author: " + docProperties.author);
console.log("Title: " + docProperties.title);
console.log("Subject: " + docProperties.subject);
});
该文档可在以下位置找到: https ://docs.microsoft.com/en-us/javascript/api/excel/excel.documentproperties?view=excel-js-preview