Bon, je n'arrive pas à joindre le fichier mais voila la partie principale du code VBA (il est en plusieurs parties ds le fichier mais cette partie est de loin la + importante).
Encore merci.
Private Sub CommandButton1_Click()
Dim Arobase As String
Dim Point As String
Dim Vide As Variant
If OptionButton1 = False And OptionButton2 = False Then
MsgBox 'Vous Devez Faire un Choix pour ce que vous désirez envoyer', vbExclamation, USF2.X
Exit Sub
End If
If TextBox1.Value = '' Then
MsgBox 'vous avez oublié de rentrer une adresse'
OptionButton1.Value = False
OptionButton2.Value = False
TextBox1.SetFocus
Exit Sub
End If
MailAdresse = TextBox1
If TextBox2.Value = '' Then
MsgBox 'vous avez oublié de rentrer un objet'
OptionButton1.Value = False
OptionButton2.Value = False
TextBox2.SetFocus
Exit Sub
End If
MailSubject = TextBox2
mailbody = 'test vlkdfhgkjfhgkljhfdkgjdjfghfkgkjghhhhhhhhhhhhhhhhhhhhhhhhhhhh'
On Error GoTo BadMail
Arobase = Application.WorksheetFunction.Search('@', MailAdresse, 1)
Point = Application.WorksheetFunction.Search('.', MailAdresse, 1)
On Error GoTo Suite
Vide = Application.WorksheetFunction.Search(' ', MailAdresse, 1)
Suite:
If Vide <> '' Then GoTo BadMail
If OptionButton1.Value = True Then
Unload Me
USF2.Show
End If
If OptionButton2.Value = True Then
Unload Me
SortirUserForm
End If
Exit Sub
BadMail:
MsgBox 'L'adresse Email ne semble pas valide'
TextBox1.SetFocus
End Sub