Aspose::Cells::Properties::DocumentPropertyCollection class

DocumentPropertyCollection class

Base class for BuiltInDocumentPropertyCollection and CustomDocumentPropertyCollection collections.

class DocumentPropertyCollection

Methods

MethodDescription
Contains(const U16String& name)Returns true if a property with the specified name exists in the collection.
Contains(const char16_t* name)Returns true if a property with the specified name exists in the collection.
DocumentPropertyCollection(DocumentPropertyCollection_Impl* impl)Constructs from an implementation object.
DocumentPropertyCollection(const DocumentPropertyCollection& src)Copy constructor.
Get(int32_t index)Returns a DocumentProperty object by index.
Get(const U16String& name)Returns a DocumentProperty object by the name of the property.
Get(const char16_t* name)Returns a DocumentProperty object by the name of the property.
GetCount()
IndexOf(const U16String& name)Gets the index of a property by name.
IndexOf(const char16_t* name)Gets the index of a property by name.
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const DocumentPropertyCollection& src)operator=
Remove(const U16String& name)Removes a property with the specified name from the collection.
Remove(const char16_t* name)Removes a property with the specified name from the collection.
RemoveAt(int32_t index)Removes a property at the specified index.
~DocumentPropertyCollection()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiate a Workbook object by calling its empty constructor
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