0

I can retrieve the 'Date Taken' of a JPEG but cannot get it for a MOV file. In File Manager there is a field that is called 'Date' which shows the same day as 'Date Taken' but it also includes MOV files.

It is the DATE field in File Manager I want to use. Can this be done? and how?

Below is the code to retrieve image properties.

Sub RenameFiles()
Dim resultsArray()
Const PATH_FOLDER As String = "C:\Users\tropi\Desktop\Photos\"
    
    resultsArray() = folderInfo(PATH_FOLDER)
    
End Sub

Public Function folderInfo(ByVal PATH_FOLDER As String) As Variant
Dim objShell As Object
Dim objFolder As Object
Dim i As Long
Dim fileName As Object

    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(Left$(PATH_FOLDER, Len(PATH_FOLDER) - 1))

    Cells(1, 1) = "FROM:"
    Cells(1, 2) = "TO:"
    For Each fileName In objFolder.Items
            For i = 0 To 35
                    Cells(i + 1, 1) = objFolder.GetDetailsOf(objFolder.Items, i)
                    Cells(i + 1, 3) = objFolder.GetDetailsOf(fileName, i)
            Next i
    Next fileName
    
End Function

Below is a screen shot of 'File Manager'

Screen Shot of File Manager

Thanks.

John
  • 33
  • 6
  • https://stackoverflow.com/questions/16627441/excel-vba-using-filesystemobject-to-list-file-last-date-modified – braX May 28 '22 at 06:15
  • Thanks braX. Unfortunately the suggested link does not address my issue. Please note the screen shot above. It is the value in the DATE field I want to access. In ALL cases, this displays the date the jpg/mov was taken. Thanks for your imput. – John May 30 '22 at 00:26
  • https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/datelastmodified-property – braX May 30 '22 at 00:36
  • Thanks again braX for your time to assist. Your reference is aimed at Date Modified. I am ok with Date Modified, Date Created, and Date Taken. It is the field that is headed Date that I cant get. In the Date Field I have the date I want for all file types unlike Date Created that shows nothing for MOV files. Please refer to the screen shot above. Thanks, – John May 31 '22 at 00:40
  • "Date Taken" is meta data (data which is optionally added) - not file data, so if a file does not have any meta data for it, then you cannot get it. Apparently MOV files do not have that metadata information to extract – braX May 31 '22 at 02:08
  • Thats it. Thats why I want the data in the DATE field as pictured above. – John May 31 '22 at 03:51

0 Answers0