I
idyllicabyss
I can access most of a files attributes and info using FSO commands but
this does not give me acces to the Comments properties.
Can anyone help? Ideally I want to be able to modify the Comments as
well.
My current code is listed below.
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scripting.Folder, SubFolder As Scripting.Folder
Dim FileItem As Scripting.File
Dim r As Long
Set FSO = New Scripting.FileSystemObject
Set SourceFolder = FSO.GetFolder(SourceFolderName)
r = Range("A65536").End(xlUp).Row + 1
For Each FileItem In SourceFolder.Files
Cells(r, 1).Formula = Left(FileItem.Path, Len(FileItem.Path) -
Len(FileItem.Name) - 1)
Cells(r, 2).Formula = FileItem.Name
Cells(r, 5).Formula = FileItem.Size
Cells(r, 6).Formula = FileItem.Type
Cells(r, 7).Formula = FileItem.DateCreated
Cells(r, 8).Formula = FileItem.DateLastAccessed
Cells(r, 9).Formula = FileItem.DateLastModified
Cells(r, 10).Formula = FileItem.Attributes
Cells(r, 11).Formula = FileItem.Comments ' Comments Doesn't
work
Cells(r, 12).Formula = FileItem.ShortPath & FileItem.ShortName
next FileItem
this does not give me acces to the Comments properties.
Can anyone help? Ideally I want to be able to modify the Comments as
well.
My current code is listed below.
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scripting.Folder, SubFolder As Scripting.Folder
Dim FileItem As Scripting.File
Dim r As Long
Set FSO = New Scripting.FileSystemObject
Set SourceFolder = FSO.GetFolder(SourceFolderName)
r = Range("A65536").End(xlUp).Row + 1
For Each FileItem In SourceFolder.Files
Cells(r, 1).Formula = Left(FileItem.Path, Len(FileItem.Path) -
Len(FileItem.Name) - 1)
Cells(r, 2).Formula = FileItem.Name
Cells(r, 5).Formula = FileItem.Size
Cells(r, 6).Formula = FileItem.Type
Cells(r, 7).Formula = FileItem.DateCreated
Cells(r, 8).Formula = FileItem.DateLastAccessed
Cells(r, 9).Formula = FileItem.DateLastModified
Cells(r, 10).Formula = FileItem.Attributes
Cells(r, 11).Formula = FileItem.Comments ' Comments Doesn't
work
Cells(r, 12).Formula = FileItem.ShortPath & FileItem.ShortName
next FileItem