CustomDocumentPropertyCollection
CustomDocumentPropertyCollection class
A collection of custom document properties.
class CustomDocumentPropertyCollection extends DocumentPropertyCollection;
Remarks
Each DocumentProperty object represents a custom property of a container document.
Example
const { Workbook } = require("aspose.cells.node");
//Instantiate a Workbook object
var workbook = new Workbook("input/CustomProperties.xlsx");
//Retrieve a list of all custom document properties of the Excel file
var customProperties = workbook.getWorksheets().getCustomDocumentProperties();
Constructors
Name | Description |
---|---|
constructor(DocumentPropertyCollection) | Constructs from a parent object convertible to this. |
Methods
Method | Description |
---|---|
add(string, string) | Creates a new custom document property of the PropertyType.String data type. |
add(string, number) | Creates a new custom document property of the PropertyType.Number data type. |
add(string, Date) | Creates a new custom document property of the PropertyType.DateTime data type. |
add(string, boolean) | Creates a new custom document property of the PropertyType.Boolean data type. |
add(string, number) | Creates a new custom document property of the PropertyType.Float data type. |
addLinkToContent(string, string) | Creates a new custom document property which links to content. |
updateLinkedPropertyValue() | Update custom document property value which links to content. |
updateLinkedRange() | Update custom document property value to linked range. |
getCount() | Gets the number of elements contained in. |
isNull() | Checks whether the implementation object is null. |
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. |
get(string) | Returns a DocumentProperty object by the name of the property. |
constructor(DocumentPropertyCollection)
Constructs from a parent object convertible to this.
constructor(obj: DocumentPropertyCollection);
Parameters:
Parameter | Type | Description |
---|---|---|
obj | DocumentPropertyCollection | The parent object. |
add(string, string)
Creates a new custom document property of the PropertyType.String data type.
add(name: string, value: string) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The name of the property. |
value | string | The value of the property. |
Returns
The newly created property object.
add(string, number)
Creates a new custom document property of the PropertyType.Number data type.
add(name: string, value: number) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The name of the property. |
value | number | The value of the property. |
Returns
The newly created property object.
add(string, Date)
Creates a new custom document property of the PropertyType.DateTime data type.
add(name: string, value: Date) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The name of the property. |
value | Date | The value of the property. |
Returns
The newly created property object.
add(string, boolean)
Creates a new custom document property of the PropertyType.Boolean data type.
add(name: string, value: boolean) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The name of the property. |
value | boolean | The value of the property. |
Returns
The newly created property object.
add(string, number)
Creates a new custom document property of the PropertyType.Float data type.
add(name: string, value: number) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The name of the property. |
value | number | The value of the property. |
Returns
The newly created property object.
addLinkToContent(string, string)
Creates a new custom document property which links to content.
addLinkToContent(name: string, source: string) : DocumentProperty;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The name of the property. |
source | string | The source of the property. It should be the name of named range. |
Returns
The newly created property object.
updateLinkedPropertyValue()
Update custom document property value which links to content.
updateLinkedPropertyValue() : void;
updateLinkedRange()
Update custom document property value to linked range.
updateLinkedRange() : void;
getCount()
Gets the number of elements contained in.
getCount() : number;
isNull()
Checks whether the implementation object is null.
isNull() : boolean;
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. |
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.