Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 1.8 KB

Excel.Workbook.CustomDocumentProperties.md

File metadata and controls

60 lines (37 loc) · 1.8 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbook.CustomDocumentProperties property (Excel)
vbaxl10.chm199094
vbaxl10.chm199094
Excel.Workbook.CustomDocumentProperties
8470adbb-5b10-96ba-71f7-c667c33b6707
05/29/2019
medium

Workbook.CustomDocumentProperties property (Excel)

Returns or sets a DocumentProperties collection that represents all the custom document properties for the specified workbook.

Syntax

expression.CustomDocumentProperties

expression A variable that represents a Workbook object.

Remarks

This property returns the entire collection of custom document properties. Use the Item method to return a single member of the collection (a DocumentProperty object) by specifying either the name of the property or the collection index (as a number).

Because the Item method is the default method for the DocumentProperties collection, the following statements are identical.

CustomDocumentProperties.Item("Complete")
CustomDocumentProperties("Complete")

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

Properties of type msoPropertyTypeString (MsoDocProperties) cannot exceed 255 characters in length.

Example

This example displays the names and values of the custom document properties as a list on worksheet one.

rw = 1 
Worksheets(1).Activate 
For Each p In ActiveWorkbook.CustomDocumentProperties 
    Cells(rw, 1).Value = p.Name 
    Cells(rw, 2).Value = p.Value 
    rw = rw + 1 
Next

[!includeSupport and feedback]