Aspose::Cells::Properties::DocumentProperty class

DocumentProperty class

Represents a custom or built-in document property.

class DocumentProperty

Methods

MethodDescription
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.
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() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const DocumentProperty& src)operator=
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

FieldDescription
_implThe 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