Solved

Rule to Mark Emails as Read in 7 days

Posted on 2011-02-15
10
278 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now