[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

IBuiltInDocumentPropertyCollection

Interface IBuiltInDocumentPropertyCollection

All Superinterfaces:
IDocumentPropertyCollection

public interface IBuiltInDocumentPropertyCollection extends IDocumentPropertyCollection
表示内置文档属性的集合。

提供对标准工作簿元数据的访问,例如作者、标题、主题、公司、管理者、应用程序名称以及其他预定义文档属性。使用 Workbook.getBuiltInDocumentProperties() 可获取此集合,并读取或更新工作簿公开的内置属性。


 IWorksheet worksheet = workbook.getWorksheets().get(0);
 worksheet.getRange("A1").setValue("Quarterly Report");
 IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
 properties.setAuthor("Author");
 properties.setCompany("Example");
 properties.setTitle("Quarterly Report");
 String xlsxFileName = "BuiltInDocumentProperties.xlsx";
 workbook.save(xlsxFileName);
 
  • Method Details

    • getManager

      String getManager()
      获取管理者属性。

      返回用于存储负责管理文档的人员姓名的内置文档属性。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setManager("Manager");
       String manager = properties.getManager();
       
      Returns:
      管理者属性值。如果尚未设置该属性,则返回 null。
    • setManager

      void setManager(String value)
      设置管理者属性。

      设置用于存储负责管理文档的人员姓名的内置文档属性。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setManager("Manager");
       
      Parameters:
      value - 管理者属性值;可以为 null。
    • getNameOfApplication

      String getNameOfApplication()
      获取应用程序的名称。

      使用此属性可读取存储在内置文档属性中的应用程序名称。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setNameOfApplication("Example App");
       String applicationName = properties.getNameOfApplication();
       
      Returns:
      应用程序名称。
    • setNameOfApplication

      void setNameOfApplication(String value)
      设置应用程序的名称。

      使用此属性可设置存储在内置文档属性中的应用程序名称。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setNameOfApplication("Example App");
       
      Parameters:
      value - 应用程序名称。
    • getPages

      int getPages()
      获取文档页数的估计值。

      使用此属性可获取存储估计页数的内置文档元数据值。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setPages(12);
       int pages = properties.getPages();
       
      Returns:
      文档的估计页数。
    • setPages

      void setPages(int value)
      设置文档页数的估计值。

      使用此属性可设置存储估计页数的内置文档元数据值。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setPages(12);
       
      Parameters:
      value - 文档的估计页数。
    • getRevisionNumber

      String getRevisionNumber()
      获取文档的修订号。

      使用此属性可获取存储在内置文档属性中的修订号。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setRevisionNumber("5");
       String revisionNumber = properties.getRevisionNumber();
       
      Returns:
      文档的修订号。
    • setRevisionNumber

      void setRevisionNumber(String value)
      设置文档的修订号。

      使用此属性可将修订号存储到内置文档属性中。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setRevisionNumber("5");
       
      Parameters:
      value - 文档的修订号。
    • getTemplate

      String getTemplate()
      获取文档模板的信息性名称。

      使用此属性可获取存储在内置文档属性中的模板名称。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setTemplate("Quarterly Report Template");
       String template = properties.getTemplate();
       
      Returns:
      文档模板的信息性名称。
    • setTemplate

      void setTemplate(String value)
      设置文档模板的信息性名称。

      使用此属性可设置存储在内置文档属性中的模板名称。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setTemplate("Quarterly Report Template");
       
      Parameters:
      value - 文档模板的信息性名称。
    • getTitle

      String getTitle()
      获取文档的标题。

      此方法返回内置 Title 文档属性的值。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setTitle("Quarterly Sales Report");
       String title = properties.getTitle();
       
      Returns:
      文档的标题。
    • setTitle

      void setTitle(String value)
      设置文档的标题。

      此方法设置内置 Title 文档属性的值。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setTitle("Quarterly Sales Report");
       
      Parameters:
      value - 文档的标题。
    • getTotalEditingTime

      int getTotalEditingTime()
      获取总编辑时间(以分钟为单位)。

      此属性存储为文档记录的累计编辑时间。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setTotalEditingTime(90);
       int totalEditingTime = properties.getTotalEditingTime();
       
      Returns:
      总编辑时间,以分钟为单位。
    • setTotalEditingTime

      void setTotalEditingTime(int value)
      设置总编辑时间(以分钟为单位)。

      此属性存储为文档记录的累计编辑时间。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setTotalEditingTime(90);
       
      Parameters:
      value - 总编辑时间,以分钟为单位。
    • getDocumentVersion

      String getDocumentVersion()
      获取文件的版本。

      此属性表示存储在工作簿中的内置文档版本。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setDocumentVersion("2.1");
       String documentVersion = properties.getDocumentVersion();
       
      Returns:
      文件的文档版本。
    • setDocumentVersion

      void setDocumentVersion(String value)
      设置文件的版本。

      此属性表示存储在工作簿中的内置文档版本。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setDocumentVersion("2.1");
       
      Parameters:
      value - 文件的文档版本。
    • getScaleCrop

      boolean getScaleCrop()
      获取文档缩略图的显示模式。

      使用此属性可以确定文档缩略图是否以缩放裁剪模式显示。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setScaleCrop(true);
       boolean scaleCrop = properties.getScaleCrop();
       
      Returns:
      如果文档缩略图使用缩放裁剪模式,则为 true;否则为 false。
    • setScaleCrop

      void setScaleCrop(boolean value)
      设置文档缩略图的显示模式。

      使用此属性可设置文档缩略图是否以缩放裁剪模式显示。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setScaleCrop(true);
       
      Parameters:
      value - 如果文档缩略图使用缩放裁剪模式,则为 true;否则为 false。
    • getSubject

      String getSubject()
      获取文档的主题。

      使用此方法可从文档元数据中检索内置主题属性。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setSubject("Quarterly Sales Report");
       String subject = properties.getSubject();
       
      Returns:
      文档的主题。
    • setSubject

      void setSubject(String value)
      设置文档的主题。

      使用此方法可从文档元数据中设置内置主题属性。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setSubject("Quarterly Sales Report");
       
      Parameters:
      value - 文档的主题。
    • getLastSavedTime

      Calendar getLastSavedTime()
      获取上次保存时的本地时区时间。

      修改文档时,此属性不会自动更新。使用 setLastSavedTime(Calendar) 可更改存储的值。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       Calendar lastSavedTime = Calendar.getInstance();
       lastSavedTime.set(2024, Calendar.JANUARY, 15, 10, 30, 0);
       properties.setLastSavedTime(lastSavedTime);
       Calendar savedTime = properties.getLastSavedTime();
       
      Returns:
      上次保存时的本地时区时间。
    • setLastSavedTime

      void setLastSavedTime(Calendar value)
      设置文档上次保存时的本地时区时间。

      使用此方法可以显式指定内置文档属性值。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       Calendar lastSavedTime = Calendar.getInstance();
       lastSavedTime.set(2024, Calendar.JANUARY, 15, 10, 30, 0);
       properties.setLastSavedTime(lastSavedTime);
       
      Parameters:
      value - 本地时区的上次保存时间。允许为 null。
    • getLastSavedBy

      String getLastSavedBy()
      获取上次保存文档的作者名称。

      修改文档时,此属性不会自动更新。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setLastSavedBy("Author");
       String lastSavedBy = properties.getLastSavedBy();
       
      Returns:
      上次保存文档的作者名称。
    • setLastSavedBy

      void setLastSavedBy(String value)
      设置上次保存文档的作者名称。

      修改文档时,此属性不会自动更新。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setLastSavedBy("Author");
       
      Parameters:
      value - 上次保存文档的作者名称。
    • getLastPrinted

      Calendar getLastPrinted()
      获取文档上次打印时的 UTC 时间。

      在读取上次打印时间之前,使用 setLastPrinted(Calendar) 将其存储到内置文档属性中。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       Calendar lastPrinted = Calendar.getInstance();
       lastPrinted.set(2024, Calendar.JANUARY, 15, 10, 30, 0);
       properties.setLastPrinted(lastPrinted);
       Calendar printedTime = properties.getLastPrinted();
       
      Returns:
      文档上次打印时的 UTC 时间。
    • setLastPrinted

      void setLastPrinted(Calendar value)
      设置文档上次打印时的 UTC 时间。

      使用此方法可将上次打印时间戳存储到内置文档属性中。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       Calendar lastPrinted = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
       lastPrinted.set(2024, Calendar.JANUARY, 15, 9, 30, 0);
       properties.setLastPrinted(lastPrinted);
       
      Parameters:
      value - 文档上次打印时的 UTC 时间。
    • getLanguage

      String getLanguage()
      获取文档语言。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setLanguage("en-US");
       String language = properties.getLanguage();
       
      Returns:
      文档语言。
    • setLanguage

      void setLanguage(String value)
      设置文档语言。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setLanguage("en-US");
       
      Parameters:
      value - 文档语言。
    • getAuthor

      String getAuthor()
      获取文档作者的名称。

      在检索作者名称之前,使用 setAuthor(String) 指定作者名称。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setAuthor("Author");
       String author = properties.getAuthor();
       
      Returns:
      文档作者的名称。
    • setAuthor

      void setAuthor(String value)
      设置文档作者的名称。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setAuthor("Author");
       
      Parameters:
      value - 文档作者的名称。
    • getComments

      String getComments()
      获取文档注释。

      使用此属性可获取存储工作簿描述性注释的内置文档元数据。要指定值,请使用 setComments(String)。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setComments("Quarterly sales report for internal review.");
       String comments = properties.getComments();
       
      Returns:
      文档注释;如果未设置注释,则为 null。
    • setComments

      void setComments(String value)
      设置文档注释。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setComments("Quarterly sales report for internal review.");
       
      Parameters:
      value - 文档注释;可以为 null。
    • getCategory

      String getCategory()
      获取文档的类别。

      使用此属性可获取存储工作簿类别的内置文档元数据。要指定值,请使用 setCategory(String)。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setCategory("Finance");
       String category = properties.getCategory();
       
      Returns:
      文档的类别。
    • setCategory

      void setCategory(String value)
      设置文档的类别。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setCategory("Finance");
       
      Parameters:
      value - 文档的类别。
    • getContentType

      String getContentType()
      获取文档的内容类型。

      使用此属性可获取描述文档内容类型的内置文档元数据。要指定值,请使用 setContentType(String)。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setContentType("Monthly Report");
       String contentType = properties.getContentType();
       
      Returns:
      文档的内容类型。
    • setContentType

      void setContentType(String value)
      设置文档的内容类型。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setContentType("Monthly Report");
       
      Parameters:
      value - 文档的内容类型。
    • getContentStatus

      String getContentStatus()
      获取文档的内容状态。

      使用此属性可读取由 Workbook.getBuiltInDocumentProperties() 返回的文档属性集合中存储的内置内容状态。要更新该值,请使用 setContentStatus(String)。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setContentStatus("Final");
       String contentStatus = properties.getContentStatus();
       
      Returns:
      文档的内容状态。
    • setContentStatus

      void setContentStatus(String value)
      设置文档的内容状态。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setContentStatus("Final");
       
      Parameters:
      value - 文档的内容状态。
    • getCompany

      String getCompany()
      获取公司属性。

      使用此属性可以检索存储在工作簿内置文档属性中的公司信息。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setCompany("Example");
       String company = properties.getCompany();
       
      Returns:
      公司属性值。如果未设置公司属性,则返回 null。
    • setCompany

      void setCompany(String value)
      设置公司属性。

      使用此属性可设置存储在工作簿内置文档属性中的公司信息。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setCompany("Example");
       
      Parameters:
      value - 公司属性值;可以为 null。
    • getHyperlinkBase

      String getHyperlinkBase()
      获取超链接基属性。

      此属性存储文档中用于超链接的基路径或 URL。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setHyperlinkBasey("https://www.example.com/docs/");
       String hyperlinkBase = properties.getHyperlinkBase();
       
      Returns:
      超链接基属性值。
    • setHyperlinkBasey

      void setHyperlinkBasey(String value)
      设置超链接基属性。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setHyperlinkBasey("https://example.com/docs/");
       
      Parameters:
      value - 超链接基属性值。
    • getCreatedDate

      Calendar getCreatedDate()
      获取文档在本地时区的创建日期。

      修改文档时,此属性不会自动更新。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       Calendar createdDateValue = new GregorianCalendar(2024, Calendar.JANUARY, 15, 10, 30, 0);
       properties.setCreatedDate(createdDateValue);
       Calendar createdDate = properties.getCreatedDate();
       
      Returns:
      文档在本地时区的创建日期。
    • setCreatedDate

      void setCreatedDate(Calendar value)
      设置文档在本地时区的创建日期。

      使用此方法可为工作簿存储内置创建日期属性。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       Calendar createdDate = new GregorianCalendar(2024, Calendar.JANUARY, 15, 9, 30, 0);
       properties.setCreatedDate(createdDate);
       
      Parameters:
      value - 文档在本地时区的创建日期。如果未指定创建日期,则允许为 null。
    • getKeywords

      String getKeywords()
      获取文档关键字。

      返回存储在内置文档属性中的关键字。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setKeywords("Budget, Forecast, Sales");
       String keywords = properties.getKeywords();
       
      Returns:
      文档关键字。
    • setKeywords

      void setKeywords(String value)
      设置文档关键字。

      设置存储在内置文档属性中的关键字。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setKeywords("Budget, Forecast, Sales");
       
      Parameters:
      value - 文档关键字。
    • getLinksUpToDate

      boolean getLinksUpToDate()
      获取文档中的超链接是否为最新。

      此内置文档属性指示文档的超链接信息是否标记为当前。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setLinksUpToDate(true);
       boolean linksUpToDate = properties.getLinksUpToDate();
       
      Returns:
      如果文档的超链接标记为最新,则为 true;否则为 false。
    • setLinksUpToDate

      void setLinksUpToDate(boolean value)
      设置文档中的超链接是否为最新。

      此内置文档属性指示文档的超链接信息是否标记为当前。

      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setLinksUpToDate(true);
       
      Parameters:
      value - 如果文档的超链接标记为最新,则为 true;否则为 false。
    • getWords

      int getWords()
      获取文档中单词数量的估计值。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setWords(320);
       int words = properties.getWords();
       
      Returns:
      文档中单词数量的估计值。
    • setWords

      void setWords(int value)
      设置文档中字数的估计值。
      
       IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
       properties.setWords(320);
       
      Parameters:
      value - 文档的估计字数。