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
| '----------------------- Vérifier si le fichier existe
Dim MyFile, Existe As Boolean
MyFile = Dir(s_CheminPhotos)
Do While MyFile <> ""
If s_Employe & ".jpg" = MyFile Then
img_Photo.Picture = s_CheminPhotos & MyFile
Existe = True
Exit Do
End If
MyFile = Dir
Loop
If Existe = True Then
cmd_PhotoExport.Visible = True
infos.Visible = False: cmd_Copier.Visible = False
'------------------- Afficher la photo
img_Photo.Picture = s_CheminPhotos & s_Employe & ".jpg"
Else
'-------------------- S'il n'y a pas de photo ou si le nom de correspond pas,
'-------------------- afficher une silhouette et un message
cmd_PhotoExport.Visible = False
img_Photo.Picture = s_CheminPhotos & "Vide.jpg"
'-------------------- Message
infos.Visible = True: cmd_Copier.Visible = True
infos.Caption = "Vous devez prendre une photo au format jpg avec une résolution d'environ 400 pixels de large " & _
"ainsi qu'un rapport entre la hauteur et la largeur de 0,75. Ce fichier, enregistré sur le disque dur, sera nommé :" & vbCrLf _
& s_Employe & ".jpg et sera intégré avec le bouton ""Intégrer la photo"""
End If |
Partager