Shrivallabha,Originally Posted by shrivallabha
Thanks for your post. I would appreciate it a lot if you or any one else in this forum can help me in finding a solution for what I want to do.
I'm trying to create a list of video files and would like to add other file parameters available for choosing in the Windows7 Choose Detail dialog window. Below are three examples of some of the Parameters I was trying to plug into the VBA code shown below:
i.e.
myfile.Comments
myFile.width
myfile.Length (i.e. length of video)
Below is the code I'm trying to modify. I have tried adding columns with these examples, and the columns are just left blank.
[vba]
Dim iRow
Sub ListFiles()
iRow = 11
Call ListMyFiles(Range("C7"), Range("C8"))
End Sub
Sub ListMyFiles(mySourcePath, IncludeSubfolders)
Set MyObject = New Scripting.FileSystemObject
Set mySource = MyObject.GetFolder(mySourcePath)
On Error Resume Next
For Each myFile In mySource.Files
iCol = 2
Cells(iRow, iCol).Value = myFile.Path
iCol = iCol + 1
Cells(iRow, iCol).Value = myFile.Name
iCol = iCol + 1
Cells(iRow, iCol).Value = myFile.Size
iCol = iCol + 1
Cells(iRow, iCol).Value = myFile.DateLastModified
iRow = iRow + 1
Cells(iRow, iCol).Value = myFile.Length
iCol = iCol + 1
Cells(iRow, iCol).Value = myFile.Width
iCol = iCol + 1
Next
If IncludeSubfolders Then
For Each mySubFolder In mySource.SubFolders
Call ListMyFiles(mySubFolder.Path, True)
Next
End If
End Sub
[/vba]
In the code above I added the LENGTH and WIDTH parameters and neither does not work. I'm also trying to get the File Name parameter to show as a hyperlink, also without success.
Attached as a zip file is the Excel file that was available for free download at Excelexperts (unlike the XLA file I uploaded in my first post, this file does not seem to be password protected). I would be very grateful if anyone out there could let me know what is the correct coding needed so that I could add additional parameters (i.e. LENGTH, WIDTH) in addition to PATH, NAME, DATE, and SIZE parameters. Any help will be greatly appreciated. Thanks.