Workbook.CustomDocumentProperties Property (2007 System)

Gets a Microsoft.Office.Core.DocumentProperties collection that represents all the custom document properties for the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CustomDocumentProperties As Object
'Usage
Dim instance As Workbook 
Dim value As Object 

value = instance.CustomDocumentProperties
[BrowsableAttribute(false)]
public Object CustomDocumentProperties { get; }
[BrowsableAttribute(false)]
public:
property Object^ CustomDocumentProperties {
    Object^ get ();
}
public function get CustomDocumentProperties () : Object

Property Value

Type: System.Object
A Microsoft.Office.Core.DocumentProperties collection that represents all the custom document properties for the workbook.

Remarks

This property returns the entire collection of custom document properties. 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).

Use the BuiltinDocumentProperties property to return the collection of built-in document properties.

Examples

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 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
private void DisplayCustomDocumentProperties()
{
    Office.DocumentProperties properties =
        (Office.DocumentProperties)this.CustomDocumentProperties;

    for (int i = 1; i <= properties.Count; i+)
    {
        Globals.Sheet1.Range["A" + i, missing].Value2 =
            properties[i].Name;
    }
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace