0

我尝试浏览文档,但未能找到有关访问 Office 365 文档的自定义属性的任何信息。我希望能够访问这些属性,以便从我的 Office 365 插件对它们执行某些操作。

自定义文档属性

我找到了这个方法 但它似乎只返回文件Url

4

1 回答 1

0

是的,你可以使用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

于 2020-04-21T09:10:40.257 回答