stacystyles
asked on
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
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.
ASKER
This is what we do right now and just don't like seeing all the unreads. ;o(
Also, BlueDevilFan has a solution over at:
https://www.experts-exchange.com/questions/26351783/OUTLOOK-delete-emails-after-5-days-rule.html
https://www.experts-exchange.com/questions/26351783/OUTLOOK-delete-emails-after-5-days-rule.html
@Anthony2oo5 - Thank you!
ASKER
We still want the emails just want to mark them as read. Thanks guys!
Hi, stacystyles.
That just requires a simple modification to the code.
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
ASKER
This looks like it worked. Any way to run this against sub folders that know of?
All subfolders or subfolders under the inbox?
ASKER
Subfolders under the Inbox
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.