Partager via


DocumentBase.CustomDocumentProperties Property

Definition

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

public:
 property System::Object ^ CustomDocumentProperties { System::Object ^ get(); };
public object CustomDocumentProperties { get; }
member this.CustomDocumentProperties : obj
Public ReadOnly Property CustomDocumentProperties As Object

Property Value

A Microsoft.Office.Core.DocumentProperties collection that represents all the custom document properties for the document.

Examples

The following code example adds a custom document property named Project Name to the document, and sets the value to White Papers. To use this example, run it from the ThisDocument class in a document-level project.

    private void DocumentCustomDocumentProperties()
    {

        Microsoft.Office.Core.DocumentProperties  prps;

        prps = (Office.DocumentProperties)this.CustomDocumentProperties;
        prps.Add("Project Name", false, Microsoft.Office.Core
            .MsoDocProperties.msoPropertyTypeString, "White Papers", missing);


    }
Private Sub DocumentCustomDocumentProperties()

    Dim prps As Microsoft.Office.Core.DocumentProperties

    prps = CType(Me.CustomDocumentProperties, Office.DocumentProperties)
    prps.Add("Project Name", False, Microsoft.Office.Core.MsoDocProperties. _
        msoPropertyTypeString, "White Papers")

End Sub 

Remarks

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

Properties of type msoPropertyTypeString cannot exceed 255 characters in length.

Applies to