2010-09-09 81 views

回答

4

您应该可以使用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 
+0

这个工作后,我启用宏完美。 Outlook 2003中的“高”安全设置甚至不允许您选择运行未签名的宏,因此切换到“中等”操作无能为力。 – Trindaz 2010-09-13 08:16:12

相关问题