|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
再加一个密件抄送人。
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, strBcc1 As String
On Error Resume Next
strBcc = "***@sina.com" '请改成你要密送的邮件地址
strBcc1 = "***@gmail.com" '请改成你要密送的邮件地址
Set objRecip = Item.Recipients.Add(strBcc)
objRecip.Type = olBCC
If Not objRecip.Resolve Then
strMsg = "不能解析密件抄送人邮件地址, " & _
"请确认是否仍然发送邮件?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"不能解析密件抄送人邮件地址")
If res = vbNo Then
Cancel = True
End If
End If
Set objRecip = Item.Recipients.Add(strBcc1)
objRecip.Type = olBCC
If Not objRecip.Resolve Then
strMsg = "不能解析密件抄送人邮件地址, " & _
"请确认是否仍然发送邮件?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"不能解析密件抄送人邮件地址")
If res = vbNo Then
Cancel = True
End If
End If
Set objRecip = Nothing
End Sub |
|