• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

Rule to Mark Emails as Read in 7 days

I would like to create a rule so that any emails that are not read in 7 days will automatically appear as read.  I am using Outlook 2010
0
stacystyles
Asked:
stacystyles
  • 4
  • 4
  • 2
1 Solution
 
Anthony2oo5Commented:
I don't think you can get a rule to do this, but you could make a rule to move the messages to a certain folder and then use auto archive the items after 7 days, and also set auto archive to set it as read.
0
 
stacystylesAuthor Commented:
This is what we do right now and just don't like seeing all the unreads.  ;o(
0
 
Anthony2oo5Commented:
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
David LeeCommented:
@Anthony2oo5 - Thank you!
0
 
stacystylesAuthor Commented:
We still want the emails just want to mark them as read.  Thanks guys!
0
 
David LeeCommented:
Hi, stacystyles.

That just requires a simple modification to the code.  
Sub MarkMessagesReadAfter7Days()
    Dim olkItems As Outlook.Items
    Set olkItems = Session.GetDefaultFolder(olFolderInbox).Items.Restrict("[UnRead] = True")
    For intCount = olkItems.count To 1 Step -1
        If DateDiff("d", olkItems.Item(intCount).ReceivedTime, Now) >= 7 Then
            olkItems.Item(intCount).Unread = False
            olkItems.Item(intCount).Save
        End If
    Next
    Set olkItems = Nothing
End Sub

Open in new window

0
 
stacystylesAuthor Commented:
This looks like it worked.  Any way to run this against sub folders that know of?
0
 
David LeeCommented:
All subfolders or subfolders under the inbox?
0
 
stacystylesAuthor Commented:
Subfolders under the Inbox
0
 
David LeeCommented:
This should do it.  Replace the code you have now with this version.
Sub ProcessInboxAndSubfolders()
    MarkMessagesReadAfter7Days Session.GetDefaultFolder(olFolderInbox)
End Sub

Sub MarkMessagesReadAfter7Days(olkFolder As Outlook.MAPIFolder)
    Dim olkItems As Outlook.Items, olkSubfolder As Outlook.MAPIFolder, intCount As Integer
    Set olkItems = olkFolder.Items.Restrict("[UnRead] = True")
    For intCount = olkItems.count To 1 Step -1
        If DateDiff("d", olkItems.Item(intCount).ReceivedTime, Now) >= 7 Then
            olkItems.Item(intCount).Unread = False
            olkItems.Item(intCount).Save
        End If
    Next
    Set olkItems = Nothing
    For Each olkSubfolder In olkFolder.Folders
        MarkMessagesReadAfter7Days olkSubfolder
    Next
    Set olkSubfolder = Nothing
End Sub

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now