如何从Outlook 2013自动BCC所有电子邮件?

时间:2014-12-10 16:25:30

标签: email outlook-vba outlook-2013

关于如何从特定发件人或特定主题自动发送BCC电子邮件有很多问题,但我找到一个简单的规则来自动BCC所有内容时遇到了很多麻烦。

1 个答案:

答案 0 :(得分:1)

这里是代码,由GroovyPost.com提供:

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
On Error Resume Next

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

Set objRecip = Item.Recipients.Add(strBcc)
objRecip.Type = olBCC
If Not objRecip.Resolve 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

Set objRecip = Nothing

End Sub

注意:脚本在您点击"发送后,"因此,在您撰写电子邮件时,您将无法在BCC字段中看到任何内容。