【问题标题】:Office 365 JavaScript API - get list of custom properties and valuesOffice 365 JavaScript API - 获取自定义属性和值列表
【发布时间】:2020-04-13 22:27:02
【问题描述】:

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

我找到了这个方法 But it only seems to return the file Url

【问题讨论】:

    标签: office365 office-js office365api custom-properties


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多