Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Rule to Mark Emails as Read in 7 days

Posted on 2011-02-15
10
282 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
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.

 
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

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.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
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…

789 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