CustomDocumentProperties Class

A collection of custom document properties.
Inheritance Hierarchy

Namespace:  Aspose.Words.Properties
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public class CustomDocumentProperties : DocumentPropertyCollection

The CustomDocumentProperties type exposes the following members.

Properties
Methods
  NameDescription
Public methodCode exampleAdd(String, Boolean)
Creates a new custom document property of the PropertyType.Boolean data type.
Public methodCode exampleAdd(String, DateTime)
Creates a new custom document property of the PropertyType.DateTime data type.
Public methodCode exampleAdd(String, Double)
Creates a new custom document property of the PropertyType.Float data type.
Public methodCode exampleAdd(String, Int32)
Creates a new custom document property of the PropertyType.Number data type.
Public methodCode exampleAdd(String, String)
Creates a new custom document property of the PropertyType.String data type.
Public methodCode exampleAddLinkToContent
Creates a new linked to content custom document property.
Public methodCode exampleClear
Removes all properties from the collection.
(Inherited from DocumentPropertyCollection.)
Public methodCode exampleContains
Returns true if a property with the specified name exists in the collection.
(Inherited from DocumentPropertyCollection.)
Public methodEquals (Inherited from Object.)
Public methodCode exampleGetEnumerator
Returns an enumerator object that can be used to iterate over all items in the collection.
(Inherited from DocumentPropertyCollection.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodCode exampleIndexOf
Gets the index of a property by name.
(Inherited from DocumentPropertyCollection.)
Public methodCode exampleRemove
Removes a property with the specified name from the collection.
(Inherited from DocumentPropertyCollection.)
Public methodCode exampleRemoveAt
Removes a property at the specified index.
(Inherited from DocumentPropertyCollection.)
Public methodToString (Inherited from Object.)
Remarks

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

Remarks

The names of the properties are case-insensitive.

The properties in the collection are sorted alphabetically by name.

Examples
Enumerates through all built-in and custom properties in a document.
Document doc = new Document(MyDir + "Properties.docx");

Console.WriteLine("1. Document name: {0}", doc.OriginalFileName);

Console.WriteLine("2. Built-in Properties");
foreach (DocumentProperty docProperty in doc.BuiltInDocumentProperties)
    Console.WriteLine("{0} : {1}", docProperty.Name, docProperty.Value);

Console.WriteLine("3. Custom Properties");
foreach (DocumentProperty docProperty in doc.CustomDocumentProperties)
    Console.WriteLine("{0} : {1}", docProperty.Name, docProperty.Value);
See Also