[]
IDocumentPropertyCollectionRepresents the custom metadata stored in a workbook. Use this collection to add, remove, and access application-defined document properties such as text, numeric, Boolean, date, and linked-content properties.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
properties.add("Revision", 3);
String fileName = "CustomDocumentProperties.xlsx";
workbook.save(fileName);
IDocumentProperty with a Boolean value and adds the property to the custom document properties available for the current Workbook.IDocumentProperty with a double-precision floating-point value and adds it to the custom document properties of the current Workbook.Workbook.IDocumentProperty with a string value and adds it to the custom document properties available for the current Workbook.IDocumentProperty with a date value and adds it to the custom document properties available for the current Workbook.addLinkToContent(String name,
String source) IDocumentProperty that is linked to workbook content and adds it to the custom document properties of the current Workbook.IDocumentProperty with a string value and adds it to the custom document properties available for the current Workbook.
IDocumentProperty property = workbook.getCustomDocumentProperties().add("Department", "Sales");
name - The name of the new IDocumentProperty.value - The string value of the property.IDocumentProperty.Workbook. The new property is added to the collection returned by Workbook.getCustomDocumentProperties().
IDocumentProperty property = workbook.getCustomDocumentProperties().add("Revision", 3);
Object value = property.getValue();
name - The name of the new IDocumentProperty.value - The integer value of the property.IDocumentProperty.IDocumentProperty with a date value and adds it to the custom document properties available for the current Workbook.
Calendar publishedOn = Calendar.getInstance();
publishedOn.set(2024, Calendar.JANUARY, 15, 0, 0, 0);
publishedOn.set(Calendar.MILLISECOND, 0);
IDocumentProperty property = workbook.getCustomDocumentProperties().add("PublishedOn", publishedOn);
PropertyType type = property.getType();
name - The name of the new IDocumentProperty.value - The date value of the property.IDocumentProperty.IDocumentProperty with a Boolean value and adds the property to the custom document properties available for the current Workbook.
IDocumentProperty property = workbook.getCustomDocumentProperties().add("IsReviewed", true);
name - The name of the new IDocumentProperty.value - The Boolean value of the property.IDocumentProperty.IDocumentProperty with a double-precision floating-point value and adds it to the custom document properties of the current Workbook.
IDocumentProperty property = workbook.getCustomDocumentProperties().add("Price", 19.95);
PropertyType type = property.getType();
name - The new IDocumentProperty name.value - The double value of the property.IDocumentProperty.IDocumentProperty that is linked to workbook content and adds it to the custom document properties of the current Workbook. The source argument specifies a workbook defined name, such as a named range. If the defined name refers to multiple cells, the property uses the value of the top-left cell.
worksheet.getRange("A1").setValue("Sales");
workbook.getNames().add("DepartmentCell", "=Sheet1!$A$1");
IDocumentProperty property = workbook.getCustomDocumentProperties().addLinkToContent("Department", "DepartmentCell");
String linkSource = property.getLinkSource();
name - The name of the new IDocumentProperty.source - The workbook defined name, such as a named range, whose referenced content is linked to the property.IDocumentProperty.