Display Metadata of files

Hi all,

i am using the following code to export to a file a folder details -

files and sub-folders in a specific folder.

i want to export the Metadata of the files as well.

any idea how i do it

oFile.title, or oFile.comments does not work...

thanks,

S

Dim oFileSystem As Object
Dim oFolder As Object
Dim oFile As Object
Dim oFiles As Object
Dim oSubFolder As Object
Dim oSubFolders As Object

Dim oOutput As Object


Public Sub WriteDir(sDirPath As String, ByRef sOutput As String)

'get the folder
Set oFolder = oFileSystem.GetFolder(sDirPath)
sOutput = sOutput & oFolder.Name & vbCrLf

'get the folders files
Set oFiles = oFolder.Files
For Each oFile In oFiles
sOutput = sOutput & vbCrLf & vbTab & oFile.Name & vbCrLf
Next

'repeat for all sub folders
Set oSubFolders = oFolder.SubFolders
For Each oSubFolder In oSubFolders
WriteDir oSubFolder.Path, sOutput
Next

End Sub

Public Sub Parse()
Set oFileSystem = CreateObject("Scripting.FileSystemObject")
Dim sOutput As String
WriteDir "C:\", sOutput

'write output to file
Set oOutput = oFileSystem.CreateTextFile("c:\Output.txt", True)
oOutput.WriteLine (sOutput)
oOutput.Close
End Sub




Answer this question

Display Metadata of files