CustomDocumentPropertyCollection
内容
[
隐藏
]CustomDocumentPropertyCollection class
自定义文档属性的集合。
public class CustomDocumentPropertyCollection : DocumentPropertyCollection
特性
| 姓名 | 描述 |
|---|---|
| Count { get; } | 获取集合中的项目数。 |
| Item { get; } | 返回一个DocumentProperty按索引的对象. |
| virtual Item { get; } | 返回一个DocumentProperty按属性名称的对象。 |
方法
| 姓名 | 描述 |
|---|---|
| Add(string, bool) | 创建一个新的自定义文档属性 PropertyType.Boolean数据类型. |
| Add(string, DateTime) | 创建一个新的自定义文档属性 属性类型.日期时间数据类型. |
| Add(string, double) | 创建一个新的自定义文档属性 PropertyType.Float数据类型. |
| Add(string, int) | 创建一个新的自定义文档属性 PropertyType.Number数据类型. |
| Add(string, string) | 创建一个新的自定义文档属性 属性类型字符串数据类型. |
| AddLinkToContent(string, string) | 创建链接到内容的新自定义文档属性。 |
| Clear() | 从集合中删除所有属性。 |
| Contains(string) | 如果集合中存在具有指定名称的属性,则返回 true。 |
| GetEnumerator() | |
| IndexOf(string) | 按名称获取属性的索引。 |
| Remove(string) | 从集合中删除具有指定名称的属性。 |
| RemoveAt(int) | 删除指定索引处的属性。 |
| UpdateLinkedPropertyValue() | 更新链接到内容的自定义文档属性值。 |
| UpdateLinkedRange() | 将自定义文档属性值更新到链接范围。 |
评论
每个DocumentPropertyobject 表示容器文档的自定义属性。
例子
[C#]
//实例化一个工作簿对象
Workbook workbook = new Workbook("book1.xls");
//检索Excel文件的所有自定义文档属性的列表
CustomDocumentPropertyCollection customProperties = workbook.Worksheets.CustomDocumentProperties;
[VB.NET]
'实例化工作簿对象
Dim workbook As New Workbook("book1.xls")
'检索 Excel 文件的所有自定义文档属性的列表
Dim customProperties As CustomDocumentPropertyCollection = workbook.Worksheets.CustomDocumentProperties