View Single Post
 
Old 02-24-2013, 11:29 AM
niton niton is offline Windows 7 64bit Office 2010 64bit
Competent Performer
 
Join Date: Jul 2012
Posts: 102
niton is on a distinguished road
Default

http://msdn.microsoft.com/en-us/libr...ffice.12).aspx

Place this in the ThisOutlookSession module. Untested

Code:
Public WithEvents myOlInspectors As Outlook.Inspectors

Private Sub Application_Startup()
    Set myOlInspectors = Application.Inspectors
End Sub

Private Sub myOlInspectors_NewInspector(ByVal Inspector As outlook.Inspector)
     Dim msg as Mailitem

     If (Inspector.CurrentItem.Class = olMail) Then

	 Set msg = Inspector.CurrentItem

            If msg.Size = 0 Then
                MsgBox "Replace the message box with your code."
           End If
     End If
     Set msg = Nothing
End Sub

Last edited by niton; 02-24-2013 at 11:32 AM. Reason: Typo in "ThisOutlookSession"
Reply With Quote