Here is the code for displaying all files in a report style listview with three subitems containing path, size and last date modified. I also want to show related icons of all files along with their filenames. How can I modify the code to achieve this functionality ??
Thanks.
VB Code:
' General Dim Fsys As New FileSystemObject ' Adds selected files to ListView1 Private Sub AddFilesToFirstListView() Dim LItem As ListItem ' Clearing previous items ListView1.ListItems.Clear ' ThisFolder is for accessing selected folder Dim ThisFolder As Folder ' AllFiles is for accessing all files in selected folder Dim AllFiles As Files ' CurrentFile is for accessing current file Dim CurrentFile As File ' Getting selected folder Set ThisFolder = Fsys.GetFolder(FolderTree1.SelectedItem.FullPath) ' Getting all files in selected folder Set AllFiles = ThisFolder.Files ' Accessing all files in selected folder For Each CurrentFile In AllFiles ' Adding items in ListView Set LItem = ListView1.ListItems.Add(, , CurrentFile.Name) LItem.SubItems(1) = FolderTree1.SelectedItem.FullPath LItem.SubItems(2) = CurrentFile.Size LItem.SubItems(3) = CurrentFile.DateLastModified Next End Sub




Reply With Quote