B
Bingo
I've the following code to add an additional recipient to
the BCC field. For some reason, this event fires twice.
What's wrong with the code? Thanks.
Private Sub m_oApp_ItemSend(ByVal Item As Object, Cancel
As Boolean)
Dim oMapiRecipient As Outlook.Recipient
Dim oMapiItm As Outlook.MailItem
Dim sModName As String
Dim sMailbox As String
On Error GoTo errHandler
Set oMapiItm = Item
sMailbox = "Recipient Name"
' Only outgoing emails need to be copied to Claimbox
If Not oMapiItm.UserProperties("Direction") Is
Nothing And _
oMapiItm.UserProperties("Direction") = "O" Then
Set oMapiRecipient = oMapiItm.Recipients.Add
(sMailbox)
With oMapiRecipient
.Resolve
.Type = olBCC
End With
cleanUp:
Set oMapiRecipient = Nothing
Set oMapiItm = Nothing
Exit Sub
errHandler:
On Error Resume Next
GoTo cleanUp
End Sub
the BCC field. For some reason, this event fires twice.
What's wrong with the code? Thanks.
Private Sub m_oApp_ItemSend(ByVal Item As Object, Cancel
As Boolean)
Dim oMapiRecipient As Outlook.Recipient
Dim oMapiItm As Outlook.MailItem
Dim sModName As String
Dim sMailbox As String
On Error GoTo errHandler
Set oMapiItm = Item
sMailbox = "Recipient Name"
' Only outgoing emails need to be copied to Claimbox
If Not oMapiItm.UserProperties("Direction") Is
Nothing And _
oMapiItm.UserProperties("Direction") = "O" Then
Set oMapiRecipient = oMapiItm.Recipients.Add
(sMailbox)
With oMapiRecipient
.Resolve
.Type = olBCC
End With
cleanUp:
Set oMapiRecipient = Nothing
Set oMapiItm = Nothing
Exit Sub
errHandler:
On Error Resume Next
GoTo cleanUp
End Sub