Class DocumentProperty
Namespace: Aspose.Cells.Properties
Assembly: Aspose.Cells.dll (25.2.0)
Represents a custom or built-in document property.
public class DocumentProperty
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
csharp
[C#]
//Instantiate a Workbook object
Workbook workbook = new Workbook("book1.xls");
//Retrieve a list of all custom document properties of the Excel file
DocumentPropertyCollection customProperties = workbook.Worksheets.CustomDocumentProperties;
//Accessng a custom document property by using the property index
DocumentProperty customProperty1 = customProperties[3];
//Accessng a custom document property by using the property name
DocumentProperty customProperty2 = customProperties["Owner"];
'Instantiate a Workbook object
Dim workbook As Workbook = New Workbook("book1.xls")
'Retrieve a list of all custom document properties of the Excel file
Dim customProperties As DocumentPropertyCollection = workbook.Worksheets.CustomDocumentProperties
'Accessng a custom document property by using the property index
Dim customProperty1 As DocumentProperty = customProperties(3)
'Accessng a custom document property by using the property name
Dim customProperty2 As DocumentProperty = customProperties("Owner")
Properties
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.
public bool IsGeneratedName { get; }
Property Value
IsLinkedToContent
Indicates whether this property is linked to content
public bool IsLinkedToContent { get; }
Property Value
Name
Returns the name of the property.
public string Name { get; }
Property Value
Source
The linked content source.
public string Source { get; }
Property Value
Type
Gets the data type of the property.
public PropertyType Type { get; }
Property Value
Value
Gets or sets the value of the property.
public object Value { get; set; }
Property Value
Methods
ToBool()
Returns the property value as bool.
public bool ToBool()
Returns
Remarks
Throws an exception if the property type is not PropertyType.Boolean.
ToDateTime()
Returns the property value as DateTime in local timezone.
public DateTime ToDateTime()
Returns
Remarks
Throws an exception if the property type is not PropertyType.Date.
ToDouble()
Returns the property value as double.
public double ToDouble()
Returns
Remarks
Throws an exception if the property type is not PropertyType.Float.
ToInt()
Returns the property value as integer.
public int ToInt()
Returns
Remarks
Throws an exception if the property type is not PropertyType.Number.
ToString()
Returns the property value as a string.
public override string ToString()
Returns
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.