aspose.cells

Class CustomDocumentPropertyCollection

A collection of custom document properties.

Each DocumentProperty object represents a custom property of a container document.

Example:

//Instantiate a Workbook object
$workbook = new cells\Workbook("book1.xlsx");
//Retrieve a list of all custom document properties of the Excel file
$customProperties = $workbook->getWorksheets()->getCustomDocumentProperties();
$customProperty1 = $customProperties->get(3);
$customProperty2 = $customProperties->get("Owner");
$customProperties->add("test1", "testv1");

Property Getters/Setters Summary
functiongetCount()
Gets number of items in the collection.
functionget(index)
Returns a DocumentProperty object by index.
functionget(name)
Returns a DocumentProperty object by the name of the property.
 
Method Summary
functionadd(name, value)
Creates a new custom document property of the PropertyType.Boolean data type.
functionadd(name, value)
Creates a new custom document property of the PropertyType.DateTime data type.
functionadd(name, value)
Creates a new custom document property of the PropertyType.Float data type.
functionadd(name, value)
Creates a new custom document property of the PropertyType.Number data type.
functionadd(name, value)
Creates a new custom document property of the PropertyType.String data type.
functionaddLinkToContent(name, source)
Creates a new custom document property which links to content.
functionclear()
Removes all properties from the collection.
functioncontains(name)
Returns true if a property with the specified name exists in the collection.
functionindexOf(name)
Gets the index of a property by name.
functioniterator()
functionremove(name)
Removes a property with the specified name from the collection.
functionremoveAt(index)
Removes a property at the specified index.
functionupdateLinkedPropertyValue()
Update custom document property value which links to content.
functionupdateLinkedRange()
Update custom document property value to linked range.
 

    • Property Getters/Setters Detail

      • getCount : Number 

        function getCount()
        
        Gets number of items in the collection.
      • get : DocumentProperty 

        function get(name)
        
        Returns a DocumentProperty object by the name of the property.

        Returns null if a property with the specified name is not found.

        Parameters:
        name - The case-insensitive name of the property to retrieve.
    • Method Detail

      • add

        function add(name, value)
        Creates a new custom document property of the PropertyType.String data type.
        Parameters:
        name: String - The name of the property.
        value: String - The value of the property.
        Returns:
        The newly created property object.
      • add

        function add(name, value)
        Creates a new custom document property of the PropertyType.Number data type.
        Parameters:
        name: String - The name of the property.
        value: Number - The value of the property.
        Returns:
        The newly created property object.
      • add

        function add(name, value)
        Creates a new custom document property of the PropertyType.DateTime data type.
        Parameters:
        name: String - The name of the property.
        value: DateTime - The value of the property.
        Returns:
        The newly created property object.
      • add

        function add(name, value)
        Creates a new custom document property of the PropertyType.Boolean data type.
        Parameters:
        name: String - The name of the property.
        value: boolean - The value of the property.
        Returns:
        The newly created property object.
      • add

        function add(name, value)
        Creates a new custom document property of the PropertyType.Float data type.
        Parameters:
        name: String - The name of the property.
        value: Number - The value of the property.
        Returns:
        The newly created property object.
      • addLinkToContent

        function addLinkToContent(name, source)
        Creates a new custom document property which links to content.
        Parameters:
        name: String - The name of the property.
        source: String - The source of the property
        Returns:
        The newly created property object.
      • updateLinkedPropertyValue

        function updateLinkedPropertyValue()
        Update custom document property value which links to content.
      • updateLinkedRange

        function updateLinkedRange()
        Update custom document property value to linked range.
      • iterator

        function iterator()
        Returns:
      • contains

        function contains(name)
        Returns true if a property with the specified name exists in the collection.
        Parameters:
        name: String - The case-insensitive name of the property.
        Returns:
        True if the property exists in the collection; false otherwise.
      • indexOf

        function indexOf(name)
        Gets the index of a property by name.
        Parameters:
        name: String - The case-insensitive name of the property.
        Returns:
        The zero based index. Negative value if not found.
      • remove

        function remove(name)
        Removes a property with the specified name from the collection.
        Parameters:
        name: String - The case-insensitive name of the property.
      • removeAt

        function removeAt(index)
        Removes a property at the specified index.
        Parameters:
        index: Number - The zero based index.
      • clear

        function clear()
        Removes all properties from the collection.