WorkbookBase.CustomDocumentProperties Свойство
Определение
Получает коллекцию Microsoft.Office.Core.DocumentProperties
, представляющую все пользовательские свойства документа для книги.Gets a Microsoft.Office.Core.DocumentProperties
collection that represents all the custom document properties for the workbook.
public object CustomDocumentProperties { get; }
Значение свойства
Коллекция Microsoft.Office.Core.Docументпропертиес
, представляющая все пользовательские свойства документа для книги.A Microsoft.Office.Core.DocumentProperties
collection that represents all the custom document properties for the workbook.
Примеры
В следующем примере кода свойство используется CustomDocumentProperties для вывода всех пользовательских свойств документа для текущей книги в столбце A листа Sheet1
.The following code example uses the CustomDocumentProperties property to display all of the custom document properties for the current workbook in column A of worksheet Sheet1
.
Этот пример предназначен для настройки на уровне документа.This example is for a document-level customization.
private void DisplayCustomDocumentProperties()
{
Office.DocumentProperties properties =
(Office.DocumentProperties)this.CustomDocumentProperties;
for (int i = 1; i <= properties.Count; i++)
{
Globals.Sheet1.Range["A" + i].Value2 =
properties[i].Name;
}
}
Private Sub DisplayCustomDocumentProperties()
Dim properties As Office.DocumentProperties = _
CType(Me.CustomDocumentProperties, Office.DocumentProperties)
Dim i As Integer
For i = 1 To properties.Count
Globals.Sheet1.Range("A" & i).Value2 = properties(i).Name
Next i
End Sub
Комментарии
Это свойство возвращает всю коллекцию пользовательских свойств документа.This property returns the entire collection of custom document properties. Используйте Microsoft.Office.Core.DocumentProperties.Item(System.Object)
свойство, чтобы вернуть один элемент коллекции ( Microsoft.Office.Core.DocumentProperties
объект), указав либо имя свойства, либо индекс коллекции (в виде числа).Use the Microsoft.Office.Core.DocumentProperties.Item(System.Object)
property to return a single member of the collection (a Microsoft.Office.Core.DocumentProperties
object) by specifying either the name of the property or the collection index (as a number).
Используйте BuiltinDocumentProperties свойство, чтобы получить коллекцию встроенных свойств документа.Use the BuiltinDocumentProperties property to return the collection of built-in document properties.