I am using the following to try and add recipients to an Outlook MailItem:
I find however, that objBCC then only contains the last recipient added in the For loop (all the addresses are valid). What am I doing wrong?
Code:
Dim objApp As outlook.Application
Dim objMail As MailItem
Dim objBCC As outlook.Recipient
On Error GoTo Err_Mail
Set objApp = CreateObject("Outlook.application")
Set objMail = objApp.CreateItem(olMailItem)
Set objBCC = objMail.Recipients.Add(pubAuditorEmail)
For i = 1 To 5
If Me.Controls("Subform" & Format(i, "0"))!keuAuditor.Column(0) <> pubAuditor_i Then
Set objBCC = objMail.Recipients.Add(Me.Controls("Subform" & Format(i, "0"))!keuAuditor.Column(2))
End If
Next i
objBCC.Type = olBCC
....
I find however, that objBCC then only contains the last recipient added in the For loop (all the addresses are valid). What am I doing wrong?