Value Property

Applies To

DocumentProperty object, PropertyTest object.

Description

DocumentProperty object: Returns or sets the value of the specified document property. Read/write Variant.

PropertyTest object: Returns the value of a property test for a file search. Read-only Variant.

Remarks

If the container application doesn't define a value for one of the built-in document properties, reading the Value property for that document property causes an error.

Example

This example displays the name, type, and value of a document property. For the example to work, dp must be a valid DocumentProperty object.

Sub DisplayPropertyInfo(dp As DocumentProperty)
    MsgBox "value = " & dp.Value & Chr(13) & _
        "type = " & dp.Type & Chr(13) & _
        "name = " & dp.Name
End Sub
This example displays the value of the search criteria (if it exists) in a dialog box. If the second value doesn't exist, the example displays another message.

With Application.FileSearch.PropertyTests(1)
If .Value = "" Then
    MsgBox "You haven't specified a value."
Else
    MsgBox "The value you've set is: " & .Value
End If
End With