OUTLOOKで送信するとき自動的にBCCをつける方法

自動仕分けのルールだとCCは設定できてもBCCは設定できないんですよね。以下のようにやります。


1.OUTLOOKを開いてAlt+F11を押す
2.VBAエディタが開く。左上のツリーを開いて(なにもいじったことなければProject1という名だと思う)、ツリーに出てきたOUTLOOKのアイコンを右クリック→コードの表示
3.以下のコードを張って閉じる。以上。

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objMe As Recipient
Set objMe = Item.Recipients.Add("myaddress@mydomain.dom")
objMe.Type = olBCC
objMe.Resolve
Set objMe = Nothing
End Sub

※ myaddress@mydomain.domはBCCで送りたいメアドに変えてください。

僕はGoogle Apps経由のGmailをPOPでOUTLOOKで受け取り、OUTLOOKで送信の際にGmailへこの方法で自動的にBCCしてます。こうすると送信メールがGmailにバックアップされるし、iGoogleにログインしたどのPCからでも送信メールをGoogle Desktop検索できるようになりますからね。

「素直にOutlookやめてGmailにすればいいやん」と思うでしょうけど、OUTLOOKの方がGTDやりやすいんですよねぇ。。そこらへん書こうと思うんですけどムック一冊ぐらいの量なのでめんどくさくてなかなか手をつけられない(笑)。→書きました


PS.Outlook Security Updateのエラーが出る場合はこちらのコードで。

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc as String

' #### USER OPTIONS ####
' address for Bcc -- must be SMTP address or resolvable
' to a name in the address book
strBcc = "someone@somewhere.dom"

On Error Resume Next
Set objRecip = Item.Recipients.Add(strBcc)
' handle case of user canceling Outlook security dialog
If Err = 287 Then
strMsg = "Could not add a Bcc recipient " & _
"because the user said No to the security prompt." & _
" Do you want still to send the message?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"Security Prompt Cancelled")
If res = vbNo Then
Cancel = True
Else
objRecip.Delete
End If
Err.Clear
Else
objRecip.Type = olBCC
objRecip.Resolve
If Not objRecip.Resolved Then
strMsg = "Could not resolve the Bcc recipient. " & _
"Do you want still to send the message?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"Could Not Resolve Bcc Recipient")
If res = vbNo Then
Cancel = True
End If
End If
End If

Set objRecip = Nothing
End Sub