View Single Post
  #2  
Old May 16th 06, 04:53 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default VBA code not starting on some Outlook 2003 clients, does on others.

This is the code that I am trying to run

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim objMe As Recipient
If test(Item) Then
Set objMe = Item.Recipients.Add("insert bcc recipient here")
objMe.Type = olBCC
objMe.Resolve
Set objMe = Nothing
End If
End Sub

Function test(objMail As Outlook.MailItem) As Boolean
Dim objRecip As Outlook.Recipient
For Each objRecip In objMail.Recipients
'when sending email to X carbon copy Y...Enter X's email address here :
If objRecip = "recipient address here" Then
test = True
End If
Next
End Function

It runs fine on some, doesn't launch on others. Going to see if it is
just the ItemSend event or vba code in general

Ads