CustomDocumentPropertyCollection

CustomDocumentPropertyCollection class

A collection of custom document properties.

public class CustomDocumentPropertyCollection : DocumentPropertyCollection

Properties

Name Description
Count { get; } Gets number of items in the collection.
Item { get; } Returns a DocumentProperty object by index.
virtual Item { get; } Returns a DocumentProperty object by the name of the property.

Methods

Name Description
Add(string, bool) Creates a new custom document property of the PropertyType.Boolean data type.
Add(string, DateTime) Creates a new custom document property of the PropertyType.DateTime data type.
Add(string, double) Creates a new custom document property of the PropertyType.Float data type.
Add(string, int) Creates a new custom document property of the PropertyType.Number data type.
Add(string, string) Creates a new custom document property of the PropertyType.String data type.
AddLinkToContent(string, string) Creates a new custom document property which links to content.
Clear() Removes all properties from the collection.
Contains(string) Returns true if a property with the specified name exists in the collection.
GetEnumerator()
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.
UpdateLinkedPropertyValue() Update custom document property value which links to content.
UpdateLinkedRange() Update custom document property value to linked range.

Remarks

Each DocumentProperty object represents a custom property of a container document.

Examples


[C#]

//Instantiate a Workbook object
Workbook workbook = new Workbook("book1.xls");

//Retrieve a list of all custom document properties of the Excel file
CustomDocumentPropertyCollection customProperties = workbook.Worksheets.CustomDocumentProperties;

[VB.NET]

'Instantiate a Workbook object
Dim workbook As New Workbook("book1.xls")

'Retrieve a list of all custom document properties of the Excel file
Dim customProperties As CustomDocumentPropertyCollection = workbook.Worksheets.CustomDocumentProperties

See Also