Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olkRecipient As Outlook.Recipient
If Item.Class = olMail Then
‘Repeat the next two lines for each address you want to copy to.’
Set olkRecipient = Item.Recipients.Add("someone@company.com") ‘<- Change the address’
olkRecipient.Type = olCC ‘<- Change olCC to olBCC if you want to use blind copy instead of carbon copy.’
Item.Save
End If
End Sub
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olkRecipient As Outlook.Recipient
If Item.Class = olMail Then
If InStr(1, Item.Subject, "Keyword/phrase") Then '<- Change the keyword/phrase. This test is case sensitive.'
'Repeat the next two lines for each address you want to copy to.'
Set olkRecipient = Item.Recipients.Add("someone@company.com") '<- Change the address'
olkRecipient.Type = olCC '<- Change olCC to olBCC if you want to use blind copy instead of carbon copy.'
Item.Save
End If
End If
End Sub
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olkRecipient As Outlook.Recipient
If Item.Class = olMail Then
If InStr(1, Item.Subject, "First keyword/phrase") Then '<- Change the keyword/phrase. This test is case sensitive.'
'Repeat the next two lines for each address you want to copy to.'
Set olkRecipient = Item.Recipients.Add("address1@company.com") '<- Change the address'
olkRecipient.Type = olCC '<- Change olCC to olBCC if you want to use blind copy instead of carbon copy.'
Item.Save
End If
If InStr(1, Item.Subject, "Second keyword/phrase") Then '<- Change the keyword/phrase. This test is case sensitive.'
'Repeat the next two lines for each address you want to copy to.'
Set olkRecipient = Item.Recipients.Add("address2@company.com") '<- Change the address'
olkRecipient.Type = olCC '<- Change olCC to olBCC if you want to use blind copy instead of carbon copy.'
Item.Save
End If
End If
End Sub
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olkRecipient As Outlook.Recipient, arrCats As Variant, varCat As Variant
If Item.Class = olMail Then
arrCats = Split(Item.Categories, ",")
For Each varCat In arrCats
Select Case varCat
Case "ProjectX"
'Repeat the next two lines for each address you want to copy to.'
Set olkRecipient = Item.Recipients.Add("ProjectX@company.com") '<- Change the address'
olkRecipient.Type = olCC '<- Change olCC to olBCC if you want to use blind copy instead of carbon copy.'
Case "ProjectY"
'Repeat the next two lines for each address you want to copy to.'
Set olkRecipient = Item.Recipients.Add("ProjectY@company.com") '<- Change the address'
olkRecipient.Type = olCC '<- Change olCC to olBCC if you want to use blind copy instead of carbon copy.'
Case "Reports"
'Repeat the next two lines for each address you want to copy to.'
Set olkRecipient = Item.Recipients.Add("someone@company.com") '<- Change the address'
olkRecipient.Type = olBCC '<- Change olCC to olBCC if you want to use blind copy instead of carbon copy.'
End Select
Next
Item.Save
End If
End Sub
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)