Bonjour,
Pourriez-vous m'apporter votre aide ?
Dans Excel, j'ai une liste de destinataires (colonne B) pour lesquels je souhaite envoyer un mail. Le corps du mail pour chaque personne se trouve en colonne C.
J'ai rédigé le code ci-dessous mais la boucle ne fonctionne pas. La colonne A contient les noms et prénoms.

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
23
24
25
26
27
28
29
 
Sub EnvoyerUnMailOutlook()
 
Dim ObjetOutlook As New Outlook.Application
Dim oBjetMail
 
 
    Set dest= Feuil2
    Set ObjetOutlook = New Outlook.Application
    Set oBjetMail = ObjetOutlook.CreateItem(olMailItem)
 
      dest.Range("A65536").End(xlUp).Select
      temp = ActiveCell.Row
 
Do
    With oBjetMail
        .To = dest.cells(temp,2) 
        .Subject = "TEST"          
        .Body = dest.cells(temp,3) 
        .Send
    End With
 
    temp = temp - 1
Loop Until temp = 1
 
    Set oBjetMail = Nothing
    Set ObjetOutlook = Nothing
 
End Sub
Merci par avance
MichaSarah