Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
An accessor property that returns a Microsoft Office DocumentProperties collection of the specified document's custom properties. Read-only Object.
expression.CustomDocumentProperties
*expression * Required. An expression that returns a Document object.
Remarks
Use BuiltInDocumentProperties and CustomDocumentProperties to return the properties of a document. The built-in properties list includes commonly used fields such as "Title," "Author," and "Creation Date." The custom document properties collection is empty by default.
Example
The following example creates a new document from a file, adds a new custom property to its custom properties collection, and then displays the list of custom properties and their values.
Sub TestCustomDocumentProperties()
Dim miDoc As MODI.Document
Dim miDocProps As Office.DocumentProperties
Dim p As Office.DocumentProperty
Dim strPropsInfo As String
Set miDoc = New MODI.Document
miDoc.Create "C:\document1.tif"
Set miDocProps = miDoc.CustomDocumentProperties
miDocProps.Add "MyCustomProperty", False, msoPropertyTypeString, "MyCustomValue"
For Each p In miDocProps
strPropsInfo = strPropsInfo & p.Name & _
": " & p.Value & vbCrLf
Next
MsgBox strPropsInfo, vbInformation + vbOKOnly, _
"Custom Document Properties"
Set miDoc = Nothing
End Sub
Applies to | Document Object