[]
IBuiltInDocumentPropertyCollection, ICustomDocumentPropertyCollectionThis interface provides access to built-in and custom document properties in a workbook. Use it to retrieve properties by name or index, check whether a property exists, get the number of properties, or remove properties from the collection.
ICustomDocumentPropertyCollection customProperties = workbook.getCustomDocumentProperties();
customProperties.add("Department", "Sales");
IDocumentPropertyCollection properties = customProperties;
IDocumentProperty property = properties.get("Department");
voidclear()booleanget(int index) IDocumentProperty object at the specified index in the collection.IDocumentProperty object with the specified name.intgetCount()intvoidvoidremoveAt(int index) This method returns the current number of properties contained in this IDocumentPropertyCollection.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
properties.add("Region", "North");
int count = properties.getCount();
IDocumentProperty object with the specified name.Use this method to retrieve a document property from the collection by its name.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
IDocumentProperty property = properties.get("Department");
name - The name of an element in the collection.IDocumentProperty object with the specified name.IDocumentProperty object at the specified index in the collection.Use this method to retrieve a document property by its position from an IDocumentPropertyCollection, such as a custom document property collection.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
IDocumentProperty property = properties.get(0);
String name = property.getName();
index - The index of the document property in the collection.IDocumentProperty object at the specified index.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
boolean contains = properties.contains("Department");
name - The name of the document property to look for.true if a document property with the specified name exists in this collection; otherwise, false.Use this method to empty a document property collection before adding a new set of properties.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
properties.add("Quarter", "Q2");
properties.clear();
The property name comparison is case-insensitive.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
int index = properties.indexOf("department");
name - The case-insensitive name of the property.The property name comparison is case-insensitive.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
properties.add("Region", "North");
properties.remove("department");
name - The case-insensitive name of the property to remove.Use this method to remove a document property by its position in the collection instead of by name.
ICustomDocumentPropertyCollection properties = workbook.getCustomDocumentProperties();
properties.add("Department", "Sales");
properties.add("Region", "North");
properties.removeAt(0);
index - The zero-based index of the property to remove.