1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Sub LireInfosJpg()
'Dans outil réferences cocher Microsoft Shell Controls and Automation
Dim Chemin As String
Dim myShell As Shell
Dim myFolder As Folder
Dim myFile As FolderItem
Dim i As Byte, f As String, lig As Long
'Indiquer le chemin du répertoire
Chemin = "C:\Users\Daniel\Documents\Donnees\Daniel\Photos\000029"
Set myShell = CreateObject("Shell.Application")
Set myFolder = myShell.Namespace(Chemin)
Set myFile = myFolder.Items.Item(f)
Application.ScreenUpdating = False
[a:ah].ClearContents
For i = 0 To 34
If myFolder.GetDetailsOf(myFile, i) <> "" Then _
Cells(1, i + 1) = myFolder.GetDetailsOf(myFile, i)
Next
'f = Dir(Chemin & "\*.mp3")
f = Dir(Chemin & "\*.jpg")
Do While Len(f) > 0
Set myFile = myFolder.Items.Item(f)
lig = [a65536].End(xlUp)(2).Row
For i = 0 To 34
If myFolder.GetDetailsOf(myFile, i) <> "" Then _
Cells(lig, i + 1) = myFolder.GetDetailsOf(myFile, i)
Next
f = Dir
lig = lig + 1
Loop
Set myShell = Nothing
Set myFolder = Nothing
Set myFile = Nothing
End Sub |
Partager