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.worksheets.customDocumentProperties;
//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");
Properties
Property | Type | Description |
---|---|---|
name | string | Readonly. Returns the name of the property. |
value | Object | Gets or sets the value of the property. |
isLinkedToContent | boolean | Readonly. Indicates whether this property is linked to content |
source | string | Readonly. The linked content source. |
type | PropertyType | Readonly. Gets the data type of the property. |
isGeneratedName | boolean | Readonly. 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. |
Methods
Method | Description |
---|---|
getName() | @deprecated. Please use the ’name’ property instead. Returns the name of the property. |
getValue() | @deprecated. Please use the ‘value’ property instead. Gets or sets the value of the property. |
setValue(Object) | @deprecated. Please use the ‘value’ property instead. Gets or sets the value of the property. |
isLinkedToContent() | @deprecated. Please use the ‘isLinkedToContent’ property instead. Indicates whether this property is linked to content |
getSource() | @deprecated. Please use the ‘source’ property instead. The linked content source. |
getType() | @deprecated. Please use the ’type’ property instead. Gets the data type of the property. |
isGeneratedName() | @deprecated. Please use the ‘isGeneratedName’ property instead. 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. |
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. |
toString() | Returns the property value as a string. |
name
Readonly. Returns the name of the property.
name : string;
value
Gets or sets the value of the property.
value : Object;
isLinkedToContent
Readonly. Indicates whether this property is linked to content
isLinkedToContent : boolean;
source
Readonly. The linked content source.
source : string;
type
Readonly. Gets the data type of the property.
type : PropertyType;
isGeneratedName
Readonly. 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;
getName()
@deprecated. Please use the ’name’ property instead. Returns the name of the property.
getName() : string;
getValue()
@deprecated. Please use the ‘value’ property instead. Gets or sets the value of the property.
getValue() : Object;
setValue(Object)
@deprecated. Please use the ‘value’ property instead. Gets or sets the value of the property.
setValue(value: Object) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | Object | The value to set. |
isLinkedToContent()
@deprecated. Please use the ‘isLinkedToContent’ property instead. Indicates whether this property is linked to content
isLinkedToContent() : boolean;
getSource()
@deprecated. Please use the ‘source’ property instead. The linked content source.
getSource() : string;
getType()
@deprecated. Please use the ’type’ property instead. Gets the data type of the property.
getType() : PropertyType;
Returns
isGeneratedName()
@deprecated. Please use the ‘isGeneratedName’ property instead. 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;
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;
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.