Existence fichier tableau html couleur
Etant novice, je cherche donc à me faire un script simple pour le completer au fur et à mesure...
Simplement : je veux si le fichier ou répertoire existe, mettre le fond la case en vert sinon en rouge et récupérer dans le tableau le nom + le chemin...
j'ai commencé mais là je suis bloquer
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Dim FSO: Set FSO = CreateObject("Scripting.FileSystemObject")
Dim Fichier: Set Fichier = FSO.CreateTextFile(SListe & "Existence.html", 1, True)
strHTML=strHTML &"<center><h2><B><font color=red>Le Fichier existe t'il dans C:\ </font></B></h2></center>" &_
"<table border='3' cellpadding='10' style='border-collapse: collapse; font size:11pt' bordercolor='#408080' width='auto' id='Table1'>" &_
"<tr><td><strong>Nom du fichier :</strong></td>" &_
"<td><strong>Chemin </strong></td>" &_
"<td><strong>Existe ? ? ?</strong></td>"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\Outils") Then 'Fichier à TROUVER
Set objFolder = objFSO.GetFile("C:\Outils") 'Fichier à TROUVER
BGFLG_Existe = "Green"
Else
BGFLG_Existe = "Red"
End If
Fichier.WriteLine strHTML 'Ecrire la structure du Tableau en HTML
Fichier.WriteLine "</table>" 'ici on ferme notre tableau par la balise </table>
'Fermeture du fichier contenant l'arborescence du répertoire à traiter
Fichier.Close |