DocumentProperty
DocumentProperty class
Represents a custom or built-in document property.
class DocumentProperty;
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();
//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("Owner");
Methods
Method | Description |
---|---|
getName() | Returns the name of the property. |
getValue() | Gets or sets the value of the property. |
setValue(object) | Gets or sets the value of the property. |
isLinkedToContent() | Indicates whether this property is linked to content |
getSource() | The linked content source. |
getType() | Gets the data type of the property. |
isGeneratedName() | Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API. |
toString() | Returns the property value as a string. |
toInt() | Returns the property value as integer. |
toDouble() | Returns the property value as double. |
toDateTime() | Returns the property value as DateTime in local timezone. |
toBool() | Returns the property value as bool. |
isNull() | Checks whether the implementation object is null. |
getName()
Returns the name of the property.
getName() : string;
getValue()
Gets or sets the value of the property.
getValue() : object;
setValue(object)
Gets or sets the value of the property.
setValue(value: object) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | object | The value to set. |
isLinkedToContent()
Indicates whether this property is linked to content
isLinkedToContent() : boolean;
getSource()
The linked content source.
getSource() : string;
getType()
Gets the data type of the property.
getType() : PropertyType;
Returns
isGeneratedName()
Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API.
isGeneratedName() : boolean;
toString()
Returns the property value as a string.
toString() : string;
Remarks
Converts a number property using Object.ToString(). Converts a boolean property into “Y” or “N”. Converts a date property into a short date string.
toInt()
Returns the property value as integer.
toInt() : number;
Remarks
Throws an exception if the property type is not PropertyType.Number.
toDouble()
Returns the property value as double.
toDouble() : number;
Remarks
Throws an exception if the property type is not PropertyType.Float.
toDateTime()
Returns the property value as DateTime in local timezone.
toDateTime() : Date;
Remarks
Throws an exception if the property type is not PropertyType.Date.
toBool()
Returns the property value as bool.
toBool() : boolean;
Remarks
Throws an exception if the property type is not PropertyType.Boolean.
isNull()
Checks whether the implementation object is null.
isNull() : boolean;