Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File properties

Status
Not open for further replies.

stralkin

Technical User
Jun 1, 2005
21
US
is there a way i can retrieve all of the file properties from a file - i know how to retrieve the file name and size with the properties of a FileSystemObject, but not how to get other properties, such as the image size or Date Picture Taken from a jpeg imported from a camera. - how do i get a complete list of the properties for a file?
 
The following code will fill a list box with all the extended properties that the Shell knows about:
Code:
[blue]Private Sub Command1_Click()

    Dim i As Long
    Dim objShell As Object
    Dim objFolder As Object
    
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace("C:\")
    
    Do Until objFolder.GetDetailsOf(objFolder.Items, i) = ""
        ListBox1.AddItem objFolder.GetDetailsOf(objFolder.Items, i)
        i = i + 1
    Loop

End Sub[/blue]

Given a specific named property from this list and a file, we can extract that value of the property (if that particular file supports it ...) something like this:

Debug.Print CreateObject("Shell.Application").Namespace("C:\Downloads").Items.Item("000-012.jpg").ExtendedProperty("Owner")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top