Dim MonOutlookS As Object
Dim MonMessage As Object
Dim corps As String
Dim MonOutlookQ As Object
Dim MonMessageQ As Object
Dim corpsQ As String
If UserForm1.OptionButton1 = True Then
Set MonOutlookS = CreateObject("Outlook.Application")
Set MonMessageS = MonOutlookS.createitem(0)
'MonMessageS.to = "Mettre adresse email"
MonMessageS.Subject = "Sécurité"
corps = "Bonjour,"
corps = corps & Chr(13) & Chr(10)
corps = corps & "Remarques : " & UserForm1.TextBox1.Value & Chr(13) & Chr(10)
corps = corps & Chr(13) & Chr(10)
corps = corps & "Ce message est envoyé lors du XXXX en date du " & Date & " à " & " " & Format(Now(), "hh:mm:ss")
MonMessageS.body = corps
MonMessageS.send
Set MonOutlookS = Nothing
End If
If UserForm1.OptionButton2 = True Then
Set MonOutlookQ = CreateObject("Outlook.Application")
Set MonMessageQ = MonOutlookQ.createitem(0)
'MonMessageQ.to = "Mettre adresse email"
MonMessageQ.Subject = "Qualité"
corpsQ = "Bonjour,"
corpsQ = corpsQ & Chr(13) & Chr(10)
corpsQ = corpsQ & "Remarques : " & UserForm1.TextBox1.Value & Chr(13) & Chr(10)
corpsQ = corpsQ & Chr(13) & Chr(10)
corpsQ = corpsQ & "Ce message est envoyé lors du XXXX en date du " & Date & " à " & " " & Format(Now(), "hh:mm:ss")
MonMessageQ.body = corpsQ
MonMessageQ.send
Set MonOutlookQ = Nothing
End If
End Sub