Macro not working properly.
Posted on 2008-10-16
I had a macro written by BlueDevilsFan that appends a string to the end of any email address that I am sending to. It worked great. However, I have found a glitch that has turned out to be very serious. Whenever I send to BCC contacts, and the string is added to those addresses in the BCC field, the addresses are somehow moved into the TO: field after hitting send. I need to know if this can be fixed or else I cant use it. The blind ccs need to stay blind or else it defeats the purpose. Any help would be greatly appreciated.
Here is the macro:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olkRecipient As Outlook.Recipient, _
olkNewRecipient As Outlook.Recipient, _
strAddress As String, _
intIndex As Integer
If Item.Class = olMail Then
For intIndex = Item.Recipients.Count To 1 Step -1
Set olkRecipient = Item.Recipients(intIndex)
If InStr(1, olkRecipient.Address, "@") Then
If Not (InStr(1, LCase(olkRecipient.Address), ".mlxjet.com") > 0) Then
strAddress = olkRecipient.Address & ".mlxjet.com"
Set olkNewRecipient = Session.CreateRecipient(strAddress)
olkNewRecipient.Type = olBCC
olkNewRecipient.Type = olkRecipient.Type