Microsoft Office Forums Outlook Rule to Delete Unread Email

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2019, 09:32 PM
Karen615 Karen615 is offline Outlook Rule to Delete Unread Email Windows 7 64bit Outlook Rule to Delete Unread Email Office 2010 64bit
Advanced Beginner
Outlook Rule to Delete Unread Email
 
Join Date: Jun 2011
Location: Chicago
Posts: 39
Karen615 is on a distinguished road
Default Outlook Rule to Delete Unread Email

Using Outlook 2013




Is it possible to create a rule for the following? I get a lot of email about newsletters and publications. If I do not read the email 48 hours after receiving it, I'd like it to be sent to the deleted folder. Is this possible?



Your help is greatly appreciated.
Reply With Quote
  #2  
Old 07-30-2019, 02:00 AM
gmayor's Avatar
gmayor gmayor is online now Outlook Rule to Delete Unread Email Windows 10 Outlook Rule to Delete Unread Email Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,903
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
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
  #3  
Old 07-31-2019, 08:19 PM
Karen615 Karen615 is offline Outlook Rule to Delete Unread Email Windows 7 64bit Outlook Rule to Delete Unread Email Office 2010 64bit
Advanced Beginner
Outlook Rule to Delete Unread Email
 
Join Date: Jun 2011
Location: Chicago
Posts: 39
Karen615 is on a distinguished road
Default

Thank you!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting a rule for incoming mails (both read and unread) - IMAP client Tajak Outlook 0 08-22-2015 09:01 AM
Outlook : Delete an existing filtering rule using VBA vadius Outlook 0 08-18-2011 03:53 AM
outlook 2003 custom email rule icons pgasparr Outlook 0 06-29-2011 06:16 AM
delete email message via blackberry and have it delete on my pop3 and my outlook Iamthestorm Outlook 2 10-28-2010 12:21 AM
outlook "Unread Email" folder automaticaly reads then dissapears emails michaelrj9 Office 0 08-20-2010 03:59 PM


All times are GMT -7. The time now is 01:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft