发送密件抄送字段为空的电子邮件之前发出警报

发送密件抄送字段为空的电子邮件之前发出警报

就像 Microsoft Outlook 会在您尝试发送一封收件人字段为空的电子邮件时弹出警报,或者尝试发送一份日历邀请时位置字段为空时弹出警报一样,我希望在将密件抄送字段留空时弹出警报。关于如何实现这一点,您有什么想法吗?

答案1

把这个 vba 放入你的thisoutlooksession模块并调整你的进行相应的宏设置

Public WithEvents myOlApp As Outlook.Application

Public Sub Initialize_handler()
    Set myOlApp = CreateObject("Outlook.Application")


End Sub

Private Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)


Dim prompt As String
prompt = "The BCC Field is empty!"



If Item.BCC = "" Then


    If msgbox(prompt, vbYesNo + vbQuestion, "BCC Field") = vbNo Then
    Cancel = True
    End If
 End If

End Sub

相关内容