Dim Rep
Dim Repjs
Rep="C:\Documents and Settings\user\Bureau\MonDiapo\img"
Repjs="C:\\Documents and Settings\\user\\Bureau\\MonDiapo\\img\\"
Dim ArrayFichier()
Dim nb_fichiers
Set fso = CreateObject("Scripting.FileSystemObject" )
Set f = fso.GetFolder(Rep)
Set MonFic = fso.CreateTextFile(Rep & "\liste.js" )
Set fc = f.Files
nb_fichiers = 0
MonFic.writeLine "var jsdiapo_images = new Array"
For Each f1 in fc
If UCase(Right(f1.name, 3)) = "JPG" or UCase(Right(f1.name, 3)) = "BMP" or UCase(Right(f1.name, 3)) = "jpg" or UCase(Right(f1.name, 3)) = "bmp" or UCase(Right(f1.name, 3)) = "GIF" or UCase(Right(f1.name, 3)) = "gif" or UCase(Right(f1.name, 3)) = "jpg" or UCase(Right(f1.name, 3)) = "bmp" Then
MonFic.writeLine "jsdiapo_images[" & nb_fichiers & "]=unescape(" & """" & Repjs & f1.name & """" & " )"
nb_fichiers=nb_fichiers+1
End if
Next
Msgbox "Écriture de la liste des images du répertoire " & Rep & " terminée" |