BCC based upon TO address

  • Thread starter Thread starter Damon Longworth
  • Start date Start date
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
 
Loop through the Recipients collection and check the Type property, it
will be olTo for anyone in the To field.

--JP
 
Back
Top