Salut à tous,
j'ais fait une procédure me permettant de vérifier la validité d'une adresse mail, à l'aide d'une fonction trouver ici même grâce à la fonction recherche. Cette fonction a été créée par Leray.
La fonction de Leray :
Envoyé par Leray
Ma procédure :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Public Sub VerifMail(adresse As String, feuil As Form) Dim at As Integer Dim point As Integer at = InStr(adresse, "@") If at < 2 Then rep = MsgBox("Adresse mail incorrecte", vbCritical + vbOKCancel, "Attention") If rep = 1 Then feuil.txtMail.SetFocus Exit Sub End If point = InStr(at, adresse, ".") If (point < (at + 2)) Then rep = MsgBox("Adresse mail incorrecte", vbCritical + vbOKCancel, "Attention") If rep = 1 Then feuil.txtMail.SetFocus Exit Sub End If End Sub
Pourriez-vous m'aider à l'optimiser ?
Gôm
Partager