Value Property

Microsoft Office Visual Basic

Returns or sets the value of a document property. Read/write Variant.

expression.Value

expression    Required. An expression that returns a DocumentProperty object.

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.

ShowValue property as it applies to the PropertyTest object.

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

expression.Value

expression    Required. An expression that returns a PropertyTest object.

Example

As it applies to the DocumentProperty object.

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
			

ShowAs it applies to the PropertyTest object.

This example displays the value of the search criteria (if it exists) in a message 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