View Single Post
 
Old 07-30-2019, 02:00 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You can do it with a macro that runs at startup in the ThisOutlookSession module e.g.

Code:
Private Sub Application_Startup()
Dim oFolder As Folder
Dim oItem As MailItem
Dim i As Long
    Set oFolder = Session.GetDefaultFolder(olFolderInbox)
    For i = oFolder.Items.Count To 1 Step -1
        If TypeName(oFolder.Items(i)) = "MailItem" Then
            Set oItem = oFolder.Items(i)
            If oItem.UnRead = True Then
                If Format(oItem.ReceivedTime, "yyyymmdd") <= Format(Date - 3, "yyyymmdd") Then
Debug.Print CStr(oItem.ReceivedTime) & vbTab & oItem.Subject
                    'oItem.Delete 'restore after testing
                End If
            End If
        End If
    Next i
lbl_Exit:
    Set oFolder = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote