DocumentBuiltInDocumentProperties Property

Returns a collection that represents all the built-in document properties of the document.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.8.0

Syntax

public BuiltInDocumentProperties BuiltInDocumentProperties { get; }

Property Value

Type: BuiltInDocumentProperties

Examples

Shows how to work with built in document properties.
Document doc = new Document(MyDir + "Properties.docx");

// Some information about the document is stored in member attributes, and can be accessed like this
Console.WriteLine($"Document filename:\n\t \"{doc.OriginalFileName}\"");

// The majority of metadata, such as author name, file size,
// word/page counts can be found in the built in properties collection like this
Console.WriteLine("Built-in Properties:");
foreach (DocumentProperty docProperty in doc.BuiltInDocumentProperties)
{
    Console.WriteLine(docProperty.Name);
    Console.WriteLine($"\tType:\t{docProperty.Type}");

    // Some properties may store multiple values
    if (docProperty.Value is Array)
    {
        foreach (object value in docProperty.Value as Array)
            Console.WriteLine($"\tValue:\t\"{value}\"");
    }
    else
    {
        Console.WriteLine($"\tValue:\t\"{docProperty.Value}\"");
    }
}

See Also