1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub CommandButton2_Click()
Dim outApp As Outlook.Application
Dim Dest As Outlook.Recipient
Dim Msg As Outlook.MailItem
Dim i As Integer
Set outApp = CreateObject("Outlook.Application")
Set Msg = outApp.CreateItem(olMailItem)
Msg.Subject = "Le sujet"
Msg.Body = "Bonjour, " & vbLf & "Vous trouverez ci joint ... "
For i = 0 To ListBox2.ListCount - 1
Set Dest = Msg.Recipients.Add(ListBox2.List(i))
Next i
If Not Dest Is Nothing Then Msg.Send
MsgBox "Terminé"
outApp.Quit
Set outApp = Nothing
End Sub |
Partager