File Extended Properties

ezfriend

Registered User.
Local time
Today, 07:41
Joined
Nov 24, 2006
Messages
242
I have a list of files which contain the full path of the file (dir & filename), how can I get the extended properties for these files?

I try to use the script

Dim arrHeaders(35)
dim sFolder as string

sfolder = "C:\Scripts"

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(sfolder ) 'objFolder = nothing even after the object is set.

It does work; however, if I were to hard-code the path in the NameSpace("c:\Scripts")


For i = 0 to 34
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)​
Next

For Each strFileName in objFolder.Items
For i = 0 to 34​
msgbox objFolder.GetDetailsOf(strFileName, i)​
Next​
Next

Any thoughts on this?

Thanks.
 
excuse my ignorance but what do you mean by extended properties?

Dave
 
You can use the GetFile method of the file system object by doing a loop on the files implied in a GetFolder method. (Look these things up in Access help.)

Once you have a file selected via GetFile, the file object has properties you can examine.

Set {file-object} = GetFile( {file-spec} )

x = {file-object}.{property}

You can explore the Access Help files to determine the properties and methods available to you with regard to the file object. I don't know if you can explore custom-defined properties, though. The file system object is built mostlyfor "standard" files.

Once you have browsed the help on File System Objects, perhaps you can ask a more specific question.
 
Strangely, this seems to work...
Code:
Set objFolder = objShell.NameSpace(Eval("""" & sFolder & """"))
 

Users who are viewing this thread

Back
Top Bottom