是否可以创建一个 Outlook 宏,以便当用户按下“回复所有人”时,会出现提示,例如“您的消息将发送给以下收件人:x、y、z。您确定吗?Y/N”。这里的关键问题是是否有可用的钩子来中断操作。
请注意,我并不想禁用它或者购买插件。
答案1
笔记:我正在使用 2007 进行工作,但我认为代码应该可以正常传输。
您可以通过 VBA 添加事件处理程序来接收ReplyAll
事件。如下所示:
Dim WithEvents insp As Outlook.Inspectors
Dim WithEvents mailItem As Outlook.MailItem
' This is called on Outlook startup
Private Sub Application_Startup()
Set insp = Application.Inspectors
End Sub
' This is called when a new Inspector is created. You use it to pick up on a new mail item event
Private Sub insp_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Size = 0 And Inspector.CurrentItem.Class = olMail Then
Set mailItem = Inspector.CurrentItem
End If
End Sub
' Called when you press ReplyAll
Private Sub mailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
Dim msg As String
Dim result As Integer
msg = "Do you really want to reply to all?"
result = MsgBox(msg, vbYesNo, "Reply All Check")
If result = vbNo Then
Cancel = True
End If
End Sub