Value
Returns or sets the current value of the Windows shell property as a Variant.
Get
Returns a Variant containing the current value of the shell property.
Syntax: object.Value
- object
- required An object expression that evaluates to a FileProperty object.
The type of the returned value depends on the property. A property that has no value for the file returns Empty. A multi-value property can return an array.
To obtain a localized string representation of the same data, use ValueDesc instead.
Let
Sets the current value of the shell property.
Syntax: object.Value = value
- value
- A Variant containing the new value for the property.
Important
Write support requires Windows Vista or newer.
Note 1.7.1.0
Assigning a property that is not writable raises run-time error -2147352567 (Exception occurred), not Permission denied (error 70). An assignment to a property of a collection opened without write support raises the same error.
Remarks
Not all shell properties are writable. To assign Value, open the file with write support enabled by passing True as the WriteSupport argument of FilePropertyExplorer.OpenFile or FilePropertyExplorer.BrowseAndOpenFile. The value is stored in the file, and a collection opened again reads it. An array assigned to a multi-value property is stored as its values.
Example
This example opens a file, reads the System.Title property, then updates it.
Dim Props As FileProperties
Set Props = FilePropertyExplorer.OpenFile("C:\Documents\Report.docx", True)
Dim Prop As FileProperty
Set Prop = Props.Item("System.Title")
Debug.Print "Current title: " & Prop.Value
Prop.Value = "Annual Report 2025"
Debug.Print "Updated title: " & Prop.Value
See Also
- ValueDesc property
- Name property
- ID property
- FileProperty class