DocumentPropertyCollection
DocumentPropertyCollection class
Base class for BuiltInDocumentPropertyCollection and CustomDocumentPropertyCollection collections.
class DocumentPropertyCollection;
Example
const { Workbook } = require("aspose.cells.node");
//Instantiate a Workbook object by calling its empty constructor
var workbook = new Workbook("input/CustomProperties.xlsx");
//Retrieve a list of all custom document properties of the Excel file
var customProperties = workbook.getWorksheets().getCustomDocumentProperties();
//Accessng a custom document property by using the property index
var customProperty1 = customProperties.get(3);
//Accessng a custom document property by using the property name
var customProperty2 = customProperties.get("rox_Meta1");
console.log("Custom Properties: " + customProperties.getCount());
Methods
Method | Description |
---|---|
get(number) | Returns a DocumentProperty object by index. |
contains(string) | Returns true if a property with the specified name exists in the collection. |
indexOf(string) | Gets the index of a property by name. |
remove(string) | Removes a property with the specified name from the collection. |
removeAt(number) | Removes a property at the specified index. |
getCount() | Gets the number of elements contained in. |
isNull() | Checks whether the implementation object is null. |
get(string) | Returns a DocumentProperty object by the name of the property. |
get(number)
Returns a DocumentProperty object by index.
get(index: number) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | Zero-based index of the DocumentProperty to retrieve. |
Returns
contains(string)
Returns true if a property with the specified name exists in the collection.
contains(name: string) : boolean;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The case-insensitive name of the property. |
Returns
True if the property exists in the collection; false otherwise.
indexOf(string)
Gets the index of a property by name.
indexOf(name: string) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The case-insensitive name of the property. |
Returns
The zero based index. Negative value if not found.
remove(string)
Removes a property with the specified name from the collection.
remove(name: string) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The case-insensitive name of the property. |
removeAt(number)
Removes a property at the specified index.
removeAt(index: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | The zero based index. |
getCount()
Gets the number of elements contained in.
getCount() : number;
isNull()
Checks whether the implementation object is null.
isNull() : boolean;
get(string)
Returns a DocumentProperty object by the name of the property.
get(name: string) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The case-insensitive name of the property to retrieve. |
Returns
Remarks
Returns null if a property with the specified name is not found.