Page tree
Skip to end of metadata
Go to start of metadata

Description

The DocumentProperties object represents properties of a spreadsheet.

  • In Excel 2003 these properties can be accessed via (File -> Properties).
  • In Excel 2007 they can be accessed via (Ribbon button -> Prepare -> Properties).
  • In Excel 2010 they can be accessed via (File -> Info -> Show All Properties on the right).
  • In Windows Explorer, right-click on the file and select 'Properties'.

The DocumentProperties class can be used to remove personal information from an existing spreadsheet, or to populate searchable fields that can be used to locate the file.

C#
vb.net

Remarks

To return a DocumentProperties object, use Workbook.DocumentProperties.

Examples

C#
vb.net

Properties

Name

Description

Application

Sets or returns the name of the application that created the spreadsheet.

Author

Sets or returns the author of the spreadsheet. The author proporty can be used to search for an Excel file.

Category

Sets or returns the category of the spreadsheet. The category property can be used to search for an Excel file.

Comments

Sets or returns the value of the Comments field in a workbook's Properties sheet. Comments can used to search for an Excel file.

Company

Sets or returns the value of the Company field in a workbook's Properties sheet. Windows can search for an Excel file using this value.

CreationDate

Sets or returns the workbook's creation date. By default, CreationDate returns the spreadsheet's actual creation date. You can set CreationDate to a different date, but this will not change the creation date displayed in the spreadsheet's Properties sheet.

Keywords

Sets or returns keywords that can be used to search for the spreadsheet. In Excel, a file's keywords are displayed in the Summary page of the Properties sheet.

LastSavedDate

Sets or returns the date on which the current spreadsheet was last saved. This value is not set by default, is not displayed in the spreadsheet's Properties sheet, and cannot be used to search for a file.

Manager

Sets or returns the value of the Manager field in the spreadsheet's Properties sheet. The manager property can be used to search for an Excel file.

Title

Sets or returns the value of the Title field in a workbook's Properties sheet. The title property can be used to search for an Excel file.

Indexers

Name

Description

Item(DocumentProperties.BuiltIn)

Returns the value of a specified built-in property. The value can be one of the following types, depending on the property: String, Double, Integer, Boolean or DateTime.

Item(String)

Returns the value of a specified property. The value can be one of the following types, depending on the property: String, Double, Integer, Boolean or DateTime.

Methods

Name

Description

Clear()

Clears all properties contained in the DocumentProperties object, removing them from the workbook's Properties sheet.

GetCustomProperty(String)

Returns the value of the custom property for the specified key. The return value can be of the following types, depending on the property: String, Double, Integer, Boolean or DateTime. (To create a custom property, use DocumentProperties.SetCustomProperty.)

RestoreDefaults()

Restores document properties values to the default set of properties and clears all others. The default set of properties are Application, CreationDate, and LastSavedDate.

SetCustomProperty(String, Object)

Use SetCustomProperty to create a custom document property. Pass the method the name and value of the property. The value can be one of the following types, depending on the property: String, Double, Integer, Boolean, or DateTime.

Nested Classes

Name

Description

BuiltIn

DocumentProperties.BuiltIn contains a set of built-in document property fields.
  • No labels