Solved

Rule to Mark Emails as Read in 7 days

Posted on 2011-02-15
10
281 Views
Last Modified: 2012-05-11
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
Comment
Question by:stacystyles
  • 4
  • 4
  • 2
10 Comments
 
LVL 1

Expert Comment

by:Anthony2oo5
ID: 34897896
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
 

Author Comment

by:stacystyles
ID: 34897910
This is what we do right now and just don't like seeing all the unreads.  ;o(
0
 
LVL 1

Expert Comment

by:Anthony2oo5
ID: 34898000
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 76

Expert Comment

by:David Lee
ID: 34898016
@Anthony2oo5 - Thank you!
0
 

Author Comment

by:stacystyles
ID: 34898027
We still want the emails just want to mark them as read.  Thanks guys!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34898131
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
 

Author Comment

by:stacystyles
ID: 34910199
This looks like it worked.  Any way to run this against sub folders that know of?
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34910325
All subfolders or subfolders under the inbox?
0
 

Author Comment

by:stacystyles
ID: 34910344
Subfolders under the Inbox
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 34910464
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question