Bonjour
voici la macro qui produit une erreur :
Sub testoutlook()
'test envoie message via outlook
Dim ofolder As Outlook.MAPIFolder
Dim oitem As Outlook.MailItem
Dim ooutlook As New Outlook.Application
Dim mooutlook As Outlook.Namespace
Dim i As Byte
Set mooutlook = ooutlook.GetNamespace("MAPI")
Set ofolder = mooutlook.GetDefaultFolder(olFolderOutbox)
Set oitem = ofolder.Items.Add(olMailItem)
With oitem
For i = 1 To 2
.Recipients.Add (Range("a" & i).Value) '< ------------------------------------------ Erreur sur boucle
.Subject = Range("b" & i).Value
.Body = Range("c" & i).Value
.Send
'myItem.Display
Next i
End With
End Sub
Voir PJ
MERCI
carlos
voici la macro qui produit une erreur :
Sub testoutlook()
'test envoie message via outlook
Dim ofolder As Outlook.MAPIFolder
Dim oitem As Outlook.MailItem
Dim ooutlook As New Outlook.Application
Dim mooutlook As Outlook.Namespace
Dim i As Byte
Set mooutlook = ooutlook.GetNamespace("MAPI")
Set ofolder = mooutlook.GetDefaultFolder(olFolderOutbox)
Set oitem = ofolder.Items.Add(olMailItem)
With oitem
For i = 1 To 2
.Recipients.Add (Range("a" & i).Value) '< ------------------------------------------ Erreur sur boucle
.Subject = Range("b" & i).Value
.Body = Range("c" & i).Value
.Send
'myItem.Display
Next i
End With
End Sub
Voir PJ
MERCI
carlos