2010-09-09 65 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

相關問題