4
我发现当用户收到邮件或点击发送按钮时触发的事件,但当用户创建空白的新电子邮件时触发事件。用户创建新的空白邮件时触发Outlook 2003宏
我发现当用户收到邮件或点击发送按钮时触发的事件,但当用户创建空白的新电子邮件时触发事件。用户创建新的空白邮件时触发Outlook 2003宏
您应该可以使用NewInspector事件。例如:
Public WithEvents myOlInspectors As Outlook.Inspectors
Private Sub Application_Startup()
Initialize_handler
End Sub
Public Sub Initialize_handler()
Set myOlInspectors = Application.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
Dim msg As Outlook.MailItem
If Inspector.CurrentItem.Class = olMail Then
Set msg = Inspector.CurrentItem
If msg.Size = 0 Then
MsgBox "New message"
End If
End If
End Sub
这个工作后,我启用宏完美。 Outlook 2003中的“高”安全设置甚至不允许您选择运行未签名的宏,因此切换到“中等”操作无能为力。 – Trindaz 2010-09-13 08:16:12