BCC based upon TO address

D

Damon Longworth

Hello

I am trying to set add an address to the BCC field when a message is sent to
specific address. I have found some code to get the BCC, but do not know how
to find the address in the TO field.

How can I get the TO address into a string?

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objRec As Recipient
Set objRec = Item.Recipients.Add("(e-mail address removed)")
objRec.Type = olBCC
objRec.Resolve
Set objRec = Nothing
End Sub
 
J

JP

Loop through the Recipients collection and check the Type property, it
will be olTo for anyone in the To field.

--JP
 

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