BuiltInDocumentProperties

BuiltInDocumentProperties class

A collection of built-in document properties.

To learn more, visit the Work with Document Properties documentation article.

public class BuiltInDocumentProperties : DocumentPropertyCollection

Properties

Name Description
Author { get; set; } Gets or sets the name of the document’s author.
Bytes { get; set; } Represents an estimate of the number of bytes in the document.
Category { get; set; } Gets or sets the category of the document.
Characters { get; set; } Represents an estimate of the number of characters in the document.
CharactersWithSpaces { get; set; } Represents an estimate of the number of characters (including spaces) in the document.
Comments { get; set; } Gets or sets the document comments.
Company { get; set; } Gets or sets the company property.
ContentStatus { get; set; } Gets or sets the ContentStatus of the document.
ContentType { get; set; } Gets or sets the ContentType of the document.
Count { get; } Gets number of items in the collection.
CreatedTime { get; set; } Gets or sets date of the document creation in UTC.
HeadingPairs { get; set; } Specifies document headings and their names.
HyperlinkBase { get; set; } Specifies the base string used for evaluating relative hyperlinks in this document.
Item { get; } Returns a DocumentProperty object by index.
override Item { get; } Returns a DocumentProperty object by the name of the property.
Keywords { get; set; } Gets or sets the document keywords.
LastPrinted { get; set; } Gets or sets the date when the document was last printed in UTC.
LastSavedBy { get; set; } Gets or sets the name of the last author.
LastSavedTime { get; set; } Gets or sets the time of the last save in UTC.
Lines { get; set; } Represents an estimate of the number of lines in the document.
LinksUpToDate { get; set; } Indicates whether hyperlinks in a document are up-to-date.
Manager { get; set; } Gets or sets the manager property.
NameOfApplication { get; set; } Gets or sets the name of the application.
Pages { get; set; } Represents an estimate of the number of pages in the document.
Paragraphs { get; set; } Represents an estimate of the number of paragraphs in the document.
RevisionNumber { get; set; } Gets or sets the document revision number.
Security { get; set; } Specifies the security level of a document as a numeric value.
Subject { get; set; } Gets or sets the subject of the document.
Template { get; set; } Gets or sets the informational name of the document template.
Thumbnail { get; set; } Gets or sets the thumbnail of the document.
Title { get; set; } Gets or sets the title of the document.
TitlesOfParts { get; set; } Each string in the array specifies the name of a part in the document.
TotalEditingTime { get; set; } Gets or sets the total editing time in minutes.
Version { get; set; } Represents the version number of the application that created the document.
Words { get; set; } Represents an estimate of the number of words in the document.

Methods

Name Description
Clear() Removes all properties from the collection.
Contains(string) Returns true if a property with the specified name exists in the collection.
GetEnumerator() Returns an enumerator object that can be used to iterate over all items in the collection.
IndexOf(string) Gets the index of a property by name.
Remove(string) Removes a property with the specified name from the collection.
RemoveAt(int) Removes a property at the specified index.

Remarks

Provides access to DocumentProperty objects by their names (using an indexer) and via a set of typed properties that return values of appropriate types.

The names of the properties are case-insensitive.

The properties in the collection are sorted alphabetically by name.

Examples

Shows how to work with built-in document properties.

Document doc = new Document(MyDir + "Properties.docx");

// The "Document" object contains some of its metadata in its members.
Console.WriteLine($"Document filename:\n\t \"{doc.OriginalFileName}\"");

// The document also stores metadata in its built-in properties.
// Each built-in property is a member of the document's "BuiltInDocumentProperties" object.
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 ICollection<object>)
    {
        foreach (object value in docProperty.Value as ICollection<object>)
            Console.WriteLine($"\tValue:\t\"{value}\"");
    }
    else
    {
        Console.WriteLine($"\tValue:\t\"{docProperty.Value}\"");
    }
}

See Also