Class BuiltInDocumentPropertyCollection

BuiltInDocumentPropertyCollection class

A collection of built-in document properties.

public class BuiltInDocumentPropertyCollection : DocumentPropertyCollection

Properties

NameDescription
Author { get; set; }Gets or sets the name of the document’s author.
Bytes { get; set; }(Obsolete.) Represents an estimate of the number of bytes in the document.
Capacity { get; set; }
Category { get; set; }Gets or sets the category of the document.
Characters { get; set; }(Obsolete.) Represents an estimate of the number of characters in the document.
CharactersWithSpaces { get; set; }(Obsolete.) 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 content status of the document.
ContentType { get; set; }Gets or sets the content type of the document.
Count { get; }
CreatedTime { get; set; }Gets or sets date of the document creation in local timezone.
CreatedUniversalTime { get; set; }Gets or sets the Universal time of the document creation.
DocumentVersion { get; set; }Represents the version of the file.
HyperlinkBase { get; set; }Gets or sets the hyperlinkbase property.
Item { get; }Returns a DocumentProperty object by index.(Inherited from DocumentPropertyCollection.)
Item { get; set; }
override Item { get; }Returns a DocumentProperty object by the name of the property.
Keywords { get; set; }Gets or sets the document keywords.
Language { get; set; }Gets or sets the document’s language.
LastPrinted { get; set; }Gets or sets the date when the document was last printed in local timezone.
LastPrintedUniversalTime { get; set; }Gets or sets the Universal time when the document was last printed.
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 local timezone.
LastSavedUniversalTime { get; set; }Gets or sets the universal time of the last save.
Lines { get; set; }(Obsolete.) 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; }(Obsolete.) Represents an estimate of the number of paragraphs in the document.
RevisionNumber { get; set; }Gets or sets the document revision number.
ScaleCrop { get; set; }Indicates the display mode of the document thumbnail.
Subject { get; set; }Gets or sets the subject of the document.
Template { get; set; }Gets or sets the informational name of the document template.
Title { get; set; }Gets or sets the title of 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

NameDescription
BinarySearch(DocumentProperty)
BinarySearch(DocumentProperty, IComparer<DocumentProperty>)
BinarySearch(int, int, DocumentProperty, IComparer<DocumentProperty>)
Clear()
Contains(DocumentProperty)
Contains(string)Returns true if a property with the specified name exists in the collection.(Inherited from DocumentPropertyCollection.)
CopyTo(DocumentProperty[])
CopyTo(DocumentProperty[], int)
CopyTo(int, DocumentProperty[], int, int)
Exists(Predicate<DocumentProperty>)
Find(Predicate<DocumentProperty>)
FindAll(Predicate<DocumentProperty>)
FindIndex(Predicate<DocumentProperty>)
FindIndex(int, Predicate<DocumentProperty>)
FindIndex(int, int, Predicate<DocumentProperty>)
FindLast(Predicate<DocumentProperty>)
FindLastIndex(Predicate<DocumentProperty>)
FindLastIndex(int, Predicate<DocumentProperty>)
FindLastIndex(int, int, Predicate<DocumentProperty>)
GetEnumerator()
IndexOf(DocumentProperty)
IndexOf(string)Gets the index of a property by name.(Inherited from DocumentPropertyCollection.)
IndexOf(DocumentProperty, int)
IndexOf(DocumentProperty, int, int)
LastIndexOf(DocumentProperty)
LastIndexOf(DocumentProperty, int)
LastIndexOf(DocumentProperty, int, int)
Remove(string)Removes a property with the specified name from the collection.(Inherited from DocumentPropertyCollection.)
RemoveAt(int)Removes a property at the specified index. (2 methods)

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.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Properties;
    using System;

    public class BuiltInDocumentPropertyCollectionDemo
    {
        public static void BuiltInDocumentPropertyCollectionExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();

            // Add a new worksheet to the workbook
            Worksheet worksheet = workbook.Worksheets[0];

            // Add sample data for test
            worksheet.Cells["A1"].PutValue(1);
            worksheet.Cells["A2"].PutValue(2);
            worksheet.Cells["A3"].PutValue(3);
            worksheet.Cells["B1"].PutValue(2);
            worksheet.Cells["B2"].PutValue(3);
            worksheet.Cells["B3"].PutValue(4);
            worksheet.Cells["C1"].PutValue(5);
            worksheet.Cells["C2"].PutValue(10);
            worksheet.Cells["C3"].PutValue(15);

            // Access the built-in document properties collection
            BuiltInDocumentPropertyCollection builtInProperties = workbook.BuiltInDocumentProperties;

            // Set various built-in document properties
            builtInProperties.Author = "John Doe";
            builtInProperties.Title = "Sample Workbook";
            builtInProperties.Subject = "Demo";
            builtInProperties.Keywords = "Aspose.Cells, Demo";
            builtInProperties.Comments = "This is a sample workbook created for demonstration purposes.";
            builtInProperties.Company = "Aspose";
            builtInProperties.Category = "Demo Category";
            builtInProperties.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            builtInProperties.ContentStatus = "Draft";
            builtInProperties.Language = "en-US";
            builtInProperties.Manager = "Jane Smith";
            builtInProperties.Template = "Standard Template";
            builtInProperties.RevisionNumber = "1";
            builtInProperties.Version = "1.0";
            builtInProperties.DocumentVersion = "1.0";
            builtInProperties.ScaleCrop = true;
            builtInProperties.LinksUpToDate = true;

            // Set date and time properties
            builtInProperties.CreatedTime = DateTime.Now;
            builtInProperties.CreatedUniversalTime = DateTime.UtcNow;
            builtInProperties.LastPrinted = DateTime.Now;
            builtInProperties.LastPrintedUniversalTime = DateTime.UtcNow;
            builtInProperties.LastSavedTime = DateTime.Now;
            builtInProperties.LastSavedUniversalTime = DateTime.UtcNow;

            // Set numeric properties            
            builtInProperties.Pages = 10;
            builtInProperties.Words = 100;
            builtInProperties.TotalEditingTime = 60.0;

            // Save the workbook
            workbook.Save("BuiltInDocumentPropertyCollectionExample.xlsx");
            workbook.Save("BuiltInDocumentPropertyCollectionExample.pdf");

        }
    }
}

See Also