DocumentProperty
DocumentProperty class
Represents a custom or built-in document property.
class DocumentProperty;
Example
const { Workbook } = AsposeCells;
//Instantiate a Workbook object
var workbook = new Workbook(data);
//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 | VObject | 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 |
---|---|
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. |
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 : VObject;
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;
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.
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.