Reputation: 662
I have a folder which contains lots of photos clicked over an year.
Photos were clicked with different cameras, and the hence names of file are in different formats (follow different templates), I want to organize images by event, and I am thinking to use the date of make to sort and rename photos according to a logic.
Retrieving the metadata from image is easy as I use this code:
Public Sub GetMetadata()
Dim objFSO As Object
Dim objFolder As Object
Set objFSO = CreateObject("Shell.Application")
Set objFolder = objFSO.Namespace("C:\Users\fabrizio.carboni\Desktop\fotonido\")
For i = 0 To 40
Debug.Print i, objFolder.GetDetailsOf(objFolder.Items, i)
Next
End Sub
Here is my problem the resut is in Italian:
0 Nome
1 Dimensione
2 Tipo elemento
3 Ultima modifica
4 Data creazione
5 Data ultimo accesso
6 Attributi
And if I try
For Each objFoto In objFolder.Items
'print file name
strFotoName = objFoto.Nome
............
I get an error, how i can retreive the english name for each metadata name?!??
sorry for the trivial question but I did not find solution even on google.
Upvotes: 0
Views: 637
Reputation: 1944
You have two solutions:
Use the local variables window to get the name of those properties
Use early binding to enable IntelliSense:
Add Microsoft Shell Automation as a reference (%Windir%\System32\Shell32.dll)
Edit 1:
As per your comment, here's how to print the creation date. Simply switch the old for each loop with this:
For Each element In objFolder.Items
Debug.Print (objFolder.GetDetailsOf(element, 4))
Next
4 is the index of the creation date. You can do likewise with the other details. More information here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb787870(v=vs.85).aspx
Upvotes: 1