Document.CustomDocumentProperties Property (2007 System)
Gets a DocumentProperties collection that represents all the custom document properties for the document.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CustomDocumentProperties As Object
'Usage
Dim instance As Document
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 DocumentProperties collection that represents all the custom document properties for the document.
Remarks
Use the BuiltInDocumentProperties property to return the collection of built-in document properties.
Properties of type msoPropertyTypeString cannot exceed 255 characters in length.
Examples
The following code example adds a custom document property named Project Name to the document, and sets the value to White Papers.
This example is for a document-level customization.
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
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);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.