我在ItemSend
中插入了代碼並保存了ThisOutlookSession模塊。它曾經工作過,不再有效。它被保存爲VBAproject.OTM,並且在重新啓動Outlook後打開模塊時仍然存在。BCC在Outlook 2007中的ItemSend事件中不再有效
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 = "[email protected]"
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
FWIW電子郵件地址將始終解決,因此無需調用「解析方法」或檢查其值。 – JimmyPena 2011-11-18 17:40:41