1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| fichier = Cells(I, 2).FormulaR1C1
' ecrire dans index
nom2 = ThisWorkbook.Path & "\web" & Worksheets("accueil").Cells(1, 1) & "\pages\images\photos\" & Cells(I, 2).FormulaR1C1 & ".JPG" 'la photo
res1 = Dir(nom2, vbSystem) 'Vérification si le fichier éxiste
If res1 = "" Then ' si il n' existe pas
Print #1, "<a href=" & Chr(34) & " pages/" & fichier & ".htm " & Chr(34) & " target=" & Chr(34) & "_top" & Chr(34) & " name=" & En & "><span class=type>" & Cells(I, 2).FormulaR1C1 & "</span></a><br>"
Else ' si il existe
Print #1, "<table><tr><td align=left>" & "<a href=" & Chr(34) & " pages/" & fichier & ".htm " & Chr(34) & " target=" & Chr(34) & "_top" & Chr(34) & " name=" & En & "><span class=typephoto>" & Cells(I, 2).FormulaR1C1 & "</span></a><br>" & "</td>" _
; "<td>" & "<a href=images\photos\"; fichier; ".JPG><img src=images\photo.jpg width=20 alt="; photo; ">" & "</td></tr></table>"
End If |