?
Solved

outlook rule for unread email

Posted on 2015-01-09
5
Medium Priority
?
46 Views
Last Modified: 2016-06-03
Can i create a rule in outlook that moves all UNREAD email from my Inbox older than 30 days to another folder?
0
Comment
Question by:datatechdc
[X]
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
5 Comments
 
LVL 8

Expert Comment

by:Jessie Gill, CISSP
ID: 40541046
There is nothing in the outlook rules wizard that allows this.
0
 
LVL 22

Expert Comment

by:Nick Rhode
ID: 40541047
Rules are applied as email arrives into the inbox.  You might be able to create a manual rule that you can run whenever you want but as for an automatic rule to apply to the mailbox I don't think that is possible with outlook.
0
 
LVL 24

Expert Comment

by:VB ITS
ID: 40541899
As the above experts have mentioned, this is not possible to do within Outlook.

You'll have to look at third party Outlook add-ins to do this. Perhaps have a look at Auto-Mate and see if it can do what you want as it's a pretty powerful add-in for email management. Note that it's not free, however you can trial it for 30 days to see if it can address your issue.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 40553371
datatechdc,

While you cannot do this with a rule, you can do it with a simple macro like the one below.  Let me know what version of Outlook you're using and I'll post instructions for adding the code to Outlook.

Sub MoveUnreadOver30()
    'On the next line, edit the path to the folder you want to move the unread messages to
    Const ARCHIVE_FOLDER_PATH = "Mailbox\SomeFolder"
    Const MACRO_NAME = "Move Unread Message Over 30 Days Old"
    Dim olkInb As Object, olkFld As Object, olkMsg As Object, lngPtr As Long, lngCnt As Long, datMinus30 As Date
    datMinus30 = DateAdd("d", -30, Date)
    Set olkFld = OpenOutlookFolder(ARCHIVE_FOLDER_PATH)
    Set olkInb = Session.GetDefaultFolder(olFolderInbox).Items.Restrict("[Unread] = True AND [ReceivedTime] <= '" & Format(datMinus30, "ddddd h:nn AMPM") & "'")
    For lngPtr = olkInb.Count To 1 Step -1
        If olkMsg.Class = olMail Then
            Set olkMsg = olkInb.Item(lngPtr)
            olkMsg.Move olkFld
            lngCnt = lngCnt + 1
        End If
    Next
    Set olkMsg = Nothing
    Set olkFld = Nothing
    Set olkInb = Nothing
    MsgBox "Operation complete.  I moved " & lngCnt & " messages.", vbInformation + vbOKOnly, MACRO_NAME
End Sub

Private Function OpenOutlookFolder(strFolderPath As String) As Outlook.MAPIFolder
    ' Purpose: Opens an Outlook folder from a folder path.'
    ' Written: 4/24/2009'
    ' Author:  BlueDevilFan'
    ' Outlook: All versions'
    Dim arrFolders As Variant, _
        varFolder As Variant, _
        bolBeyondRoot As Boolean
    On Error Resume Next
    If strFolderPath = "" Then
        Set OpenOutlookFolder = Nothing
    Else
        Do While Left(strFolderPath, 1) = "\"
            strFolderPath = Right(strFolderPath, Len(strFolderPath) - 1)
        Loop
        arrFolders = Split(strFolderPath, "\")
        For Each varFolder In arrFolders
            Select Case bolBeyondRoot
                Case False
                    Set OpenOutlookFolder = Outlook.Session.Folders(varFolder)
                    bolBeyondRoot = True
                Case True
                    Set OpenOutlookFolder = OpenOutlookFolder.Folders(varFolder)
            End Select
            If Err.Number <> 0 Then
                Set OpenOutlookFolder = Nothing
                Exit For
            End If
        Next
    End If
    On Error GoTo 0
End Function

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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.
Changing a few Outlook Options can help keep you organized!
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

771 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