![如何在 Outlook 中回复所有人之前提示](https://linux22.com/image/1544161/%E5%A6%82%E4%BD%95%E5%9C%A8%20Outlook%20%E4%B8%AD%E5%9B%9E%E5%A4%8D%E6%89%80%E6%9C%89%E4%BA%BA%E4%B9%8B%E5%89%8D%E6%8F%90%E7%A4%BA.png)
这应该非常简单,但事实并非如此。
我希望 Outlook 在发送回复所有人的电子邮件之前提示我。
有一个名为“NoReply to all”的插件,但是这仍然要求用户在每个会话中激活“no-reply-to-all”,这基本上违背了它的目的。
下面的代码有效,但适用于所有回复,而我只想将其应用于回复所有人。
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If MsgBox("Do you want to continue sending the mail?", vbOKCancel) <> vbOK Then
Cancel = True
End If
End Sub
微软的示例应该可以工作,但是却不行:
Public WithEvents myItem As MailItem
Sub Initialize_Handler()
Set myItem = Application.ActiveInspector.CurrentItem
End Sub
Private Sub myItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
Dim mymsg As String
Dim myResult As Integer
mymsg = "Do you really want to reply to all original recipients?"
myResult = MsgBox(mymsg, vbYesNo, "Flame Protector")
If myResult = vbNo Then
Cancel = True
End If
End Sub
其他解决方案并不免费。
有什么帮助吗?
答案1
找到了,它包括一项检查以防止发送到特定列表:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim str As String
Dim j As Integer
Dim splits() As String
Dim lbadFound As Boolean
lbadFound = False
Set Recipients = Item.Recipients
receivers = Recipients.count
For i = receivers To 1 Step -1
Set recip = Recipients.Item(i)
If InStr(1, LCase(recip), "lists.bla.com") >= 1 Then
lbadFound = True
End If
Next i
splits = Split(Item.To, ";")
If receivers > 1 Or lbadFound Or UBound(splits) > 0 Then
If MsgBox("Do you want to continue sending the mail?", vbOKCancel) <> vbOK Then
Cancel = True
End If
End If
子目录结束