Aspose::Cells::Properties::DocumentProperty class
Contents
[
Hide
]DocumentProperty class
Represents a custom or built-in document property.
class DocumentProperty
Methods
| Method | Description |
|---|---|
| DocumentProperty(DocumentProperty_Impl* impl) | Constructs from an implementation object. |
| DocumentProperty(const DocumentProperty& src) | Copy constructor. |
| GetName() | Returns the name of the property. |
| GetSource() | The linked content source. |
| GetType() | Gets the data type of the property. |
| GetValue() | Gets or sets the value 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. |
| IsLinkedToContent() | Indicates whether this property is linked to content. |
| IsNull() const | Checks whether the implementation object is nullptr. |
| explicit operator bool() const | operator bool() |
| operator=(const DocumentProperty& src) | operator= |
| SetValue(const Aspose::Cells::Object& value) | Gets or sets the value of the property. |
| ToBool() | Returns the property value as bool. |
| ToDateTime() | Returns the property value as DateTime in local timezone. |
| ToDouble() | Returns the property value as double. |
| ToInt() | Returns the property value as integer. |
| ToString() | Returns the property value as a string. |
| ~DocumentProperty() | Destructor. |
Fields
| Field | Description |
|---|---|
| _impl | The implementation object. |
Examples
Aspose::Cells::Startup();
//Instantiate a Workbook object
Workbook workbook(u"book1.xls");
//Retrieve a list of all custom document properties of the Excel file
DocumentPropertyCollection customProperties = workbook.GetWorksheets().GetCustomDocumentProperties();
//Accessng a custom document property by using the property index
DocumentProperty customProperty1 = customProperties.Get(3);
//Accessng a custom document property by using the property name
DocumentProperty customProperty2 = customProperties.Get(u"Owner");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells::Properties
- Library Aspose.Cells for C++