DocumentPropertyCollectionCount Property

Gets number of items in the collection.

Namespace:  Aspose.Words.Properties
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public int Count { get; }

Property Value

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

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

Console.WriteLine("2. Built-in Properties");
for (int i = 0; i < doc.BuiltInDocumentProperties.Count; i++)
{
    DocumentProperty docProperty = doc.BuiltInDocumentProperties[i];
    Console.WriteLine("{0}({1}) : {2}", docProperty.Name, docProperty.Type, docProperty.Value);
}

Console.WriteLine("3. Custom Properties");
for (int i = 0; i < doc.CustomDocumentProperties.Count; i++)
{
    DocumentProperty docProperty = doc.CustomDocumentProperties[i];
    Console.WriteLine("{0}({1}) : {2}", docProperty.Name, docProperty.Type, docProperty.Value);
}
See Also