[]
IDocumentPropertyCollectionProvides access to standard workbook metadata such as author, title, subject, company, manager, application name, and other predefined document properties. Use Workbook.getBuiltInDocumentProperties() to retrieve this collection and read or update built-in properties exposed by the workbook.
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);
booleanintgetPages()booleangetTitle()intintgetWords()voidvoidsetCategory(String value) voidsetComments(String value) voidsetCompany(String value) voidsetContentStatus(String value) voidsetContentType(String value) voidsetCreatedDate(Calendar value) voidsetDocumentVersion(String value) voidsetHyperlinkBasey(String value) voidsetKeywords(String value) voidsetLanguage(String value) voidsetLastPrinted(Calendar value) voidsetLastSavedBy(String value) voidsetLastSavedTime(Calendar value) voidsetLinksUpToDate(boolean value) voidsetManager(String value) voidsetNameOfApplication(String value) voidsetPages(int value) voidsetRevisionNumber(String value) voidsetScaleCrop(boolean value) voidsetSubject(String value) voidsetTemplate(String value) voidvoidsetTotalEditingTime(int value) voidsetWords(int value) Returns the built-in document property that stores the name of the person responsible for managing the document.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setManager("Manager");
String manager = properties.getManager();
null if the property has not been set.Sets the built-in document property that stores the name of the person responsible for managing the document.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setManager("Manager");
value - The manager property value. This value can be null.Use this property to read the application name stored in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setNameOfApplication("Example App");
String applicationName = properties.getNameOfApplication();
Use this property to set the application name stored in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setNameOfApplication("Example App");
value - The application name.Use this property to retrieve the built-in document metadata value that stores the estimated page count.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setPages(12);
int pages = properties.getPages();
Use this property to set the built-in document metadata value that stores the estimated page count.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setPages(12);
value - The estimated number of pages in the document.Use this property to retrieve the revision number stored in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setRevisionNumber("5");
String revisionNumber = properties.getRevisionNumber();
Use this property to store the revision number in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setRevisionNumber("5");
value - The revision number of the document.Use this property to retrieve the template name stored in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setTemplate("Quarterly Report Template");
String template = properties.getTemplate();
Use this property to set the template name stored in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setTemplate("Quarterly Report Template");
value - The informational name of the document template.This method returns the value of the built-in Title document property.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setTitle("Quarterly Sales Report");
String title = properties.getTitle();
This method Sets the value of the built-in Title document property.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setTitle("Quarterly Sales Report");
value - The title of the document.This property stores the cumulative editing time recorded for the document.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setTotalEditingTime(90);
int totalEditingTime = properties.getTotalEditingTime();
This property stores the cumulative editing time recorded for the document.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setTotalEditingTime(90);
value - The total editing time, in minutes.This property represents the built-in document version stored in the workbook.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setDocumentVersion("2.1");
String documentVersion = properties.getDocumentVersion();
This property represents the built-in document version stored in the workbook.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setDocumentVersion("2.1");
value - The document version of the file.Use this property to determine whether the document thumbnail is displayed with scale-crop mode.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setScaleCrop(true);
boolean scaleCrop = properties.getScaleCrop();
true if the document thumbnail uses scale-crop mode; otherwise, false.Use this property to set whether the document thumbnail is displayed with scale-crop mode.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setScaleCrop(true);
value - true if the document thumbnail uses scale-crop mode; otherwise, false.Use this method to retrieve the built-in subject property from the document metadata.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setSubject("Quarterly Sales Report");
String subject = properties.getSubject();
Use this method to set the built-in subject property from the document metadata.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setSubject("Quarterly Sales Report");
value - The subject of the document.This property is not automatically updated when the document is modified. Use setLastSavedTime(Calendar) to change the stored value.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
Calendar lastSavedTime = Calendar.getInstance();
lastSavedTime.set(2024, Calendar.JANUARY, 15, 10, 30, 0);
properties.setLastSavedTime(lastSavedTime);
Calendar savedTime = properties.getLastSavedTime();
Use this method to assign a built-in document property value explicitly.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
Calendar lastSavedTime = Calendar.getInstance();
lastSavedTime.set(2024, Calendar.JANUARY, 15, 10, 30, 0);
properties.setLastSavedTime(lastSavedTime);
value - The last saved time in the local time zone. null is allowed.This property is not automatically updated when the document is modified.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setLastSavedBy("Author");
String lastSavedBy = properties.getLastSavedBy();
This property is not automatically updated when the document is modified.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setLastSavedBy("Author");
value - The name of the author who last saved the document.Use setLastPrinted(Calendar) to store the last printed time in the built-in document properties before reading it back.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
Calendar lastPrinted = Calendar.getInstance();
lastPrinted.set(2024, Calendar.JANUARY, 15, 10, 30, 0);
properties.setLastPrinted(lastPrinted);
Calendar printedTime = properties.getLastPrinted();
Use this method to store the last printed timestamp in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
Calendar lastPrinted = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
lastPrinted.set(2024, Calendar.JANUARY, 15, 9, 30, 0);
properties.setLastPrinted(lastPrinted);
value - The UTC time when the document was last printed.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setLanguage("en-US");
String language = properties.getLanguage();
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setLanguage("en-US");
value - The document language.Use setAuthor(String) to assign the author name before retrieving it.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setAuthor("Author");
String author = properties.getAuthor();
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setAuthor("Author");
value - The name of the document's author.Use this property to retrieve the built-in document metadata that stores descriptive comments for the workbook. To assign a value, use setComments(String).
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setComments("Quarterly sales report for internal review.");
String comments = properties.getComments();
null if no comments have been set.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setComments("Quarterly sales report for internal review.");
value - The document comments. This value can be null.Use this property to retrieve the built-in document metadata that stores the workbook category. To assign a value, use setCategory(String).
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setCategory("Finance");
String category = properties.getCategory();
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setCategory("Finance");
value - The category of the document.Use this property to retrieve the built-in document metadata that describes the document's content type. To assign a value, use setContentType(String).
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setContentType("Monthly Report");
String contentType = properties.getContentType();
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setContentType("Monthly Report");
value - The content type of the document.Use this property to read the built-in content status stored in the document properties collection returned by Workbook.getBuiltInDocumentProperties(). To update the value, use setContentStatus(String).
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setContentStatus("Final");
String contentStatus = properties.getContentStatus();
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setContentStatus("Final");
value - The content status of the document.Use this property to retrieve the company information stored in the workbook's built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setCompany("Example");
String company = properties.getCompany();
null if the company property is not set.Use this property to set the company information stored in the workbook's built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setCompany("Example");
value - The company property value. This value can be null.This property stores the base path or URL used for hyperlinks in the document.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setHyperlinkBasey("https://www.example.com/docs/");
String hyperlinkBase = properties.getHyperlinkBase();
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setHyperlinkBasey("https://example.com/docs/");
value - The hyperlink base property value.This property is not updated automatically when the document is modified.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
Calendar createdDateValue = new GregorianCalendar(2024, Calendar.JANUARY, 15, 10, 30, 0);
properties.setCreatedDate(createdDateValue);
Calendar createdDate = properties.getCreatedDate();
Use this method to store the built-in created date property for the workbook.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
Calendar createdDate = new GregorianCalendar(2024, Calendar.JANUARY, 15, 9, 30, 0);
properties.setCreatedDate(createdDate);
value - The document creation date in the local time zone. null is allowed if no created date is specified.Returns the keywords stored in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setKeywords("Budget, Forecast, Sales");
String keywords = properties.getKeywords();
Sets the keywords stored in the built-in document properties.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setKeywords("Budget, Forecast, Sales");
value - The document keywords.This built-in document property indicates whether the document's hyperlink information is marked as current.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setLinksUpToDate(true);
boolean linksUpToDate = properties.getLinksUpToDate();
true if the document's hyperlinks are marked as up to date; otherwise, false.This built-in document property indicates whether the document's hyperlink information is marked as current.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setLinksUpToDate(true);
value - true if the document's hyperlinks are marked as up to date; otherwise, false.
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setWords(320);
int words = properties.getWords();
IBuiltInDocumentPropertyCollection properties = workbook.getBuiltInDocumentProperties();
properties.setWords(320);
value - The estimated number of words in the document.