Item.Recipients.Add Not Working for me

J

jeff.riley

Hello all,

I have the following code but I can not seemt to get it working. I am still
missing something very basic. Sue you will see this is still mostly the code
you gave me. I am just trying to add my email address to the recipients
collection if it is not already there. My problem is it goes to everyone in
the collection but me. By the way your book should arrive at my house
tomorrow. ;) Thanks in advance.

Function Item_Send()
Dim blnOKToSend
blnOKToSend = False
For Each recip in Item.Recipients
MsgBox "The current recip is: " & recip.Address
If recip.Address = "/o=BP/ou=USAHOU/cn=Users/cn=rilej3" Then
blnOKToSend = True
Exit For
End If
Next
If blnOKToSend = False Then
Item.Recipients.Add("(e-mail address removed)")
blnOKToSend = True
MsgBox "The current to list is: " & Item.To
End If
Item_Send = False
End Function
 
K

Ken Slovak - [MVP - Outlook]

Does it work better if you instantiate a Recipient object and then resolve
it?

Set oRecip = Item.Recipients.Add("(e-mail address removed)")
oRecip.Resolve
 
J

jeff.riley

Ken,

Thank you so very much. That was the piece I was missing. It is working
great now.

Thank you,
Jeff Riley
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top