|
原帖由 suke_008 于 2009-6-4 07:10 发表
大家好,我们公司个人邮箱在发送时有限制收件人数50,如果超出将无法传送.
可否用VBA实现在准备发送时提示收件者&副本以及密件人各多少个?也就是做个统计.谢谢!!
在Outlook中按Alt+F11,把下面的代码放在Thisoutlooksession中:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim Prompt As String
Dim Button As String
Dim Title As String
Prompt = "本邮件收件人总数为: " & Item.Recipients.Count & ".为了能发出邮件,请至少删除: " & Item.Recipients.Count - 50 & " 个收件人."
Button = vbOKOnly
Title = "提示"
If Item.Recipients.Count > 50 Then
MsgBox Prompt, Button, Title
Cancel = True
End If
End Sub |
评分
-
1
查看全部评分
-
|