File Extended Properties (1 Viewer)

ezfriend

Registered User.
Local time
Yesterday, 19:15
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.
 

dcobau

Registered User.
Local time
Today, 12:15
Joined
Mar 1, 2004
Messages
124
excuse my ignorance but what do you mean by extended properties?

Dave
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:15
Joined
Feb 28, 2001
Messages
27,167
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.
 

MarkK

bit cruncher
Local time
Yesterday, 19:15
Joined
Mar 17, 2004
Messages
8,180
Strangely, this seems to work...
Code:
Set objFolder = objShell.NameSpace(Eval("""" & sFolder & """"))
 

Users who are viewing this thread

Top Bottom