Solved

Outlook Auto Archive to Exchange folder

Posted on 2010-08-26
6
679 Views
Last Modified: 2012-05-10
Is there a way to Auto Archive in Outlook 2003/07/10 to another folder in the Mailbox instead of a PST file?  i.e. move all items older than a certain age out of the Inbox to another Exchange folder.  Perhaps it can be done through a rule?  I did not see (at least in 2003) a way to do it with rules, but perhaps I  missed something.  Thanks.
0
Comment
Question by:arms145
  • 2
  • 2
  • 2
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 33530277
Hi, arms145.

No, this is not possible with rules.  Rules only work when items are sent or received.  Why do you want to archive to another folder in the same mailbox?  The primary purpose of archiving is to get things out of the mailbox that are no longer needed.
0
 

Author Comment

by:arms145
ID: 33530335
No longer needed is subjective, just want to keep Inbox folder itself uncluttered for some high volume users while still keeping the messages online in the Mailbox.  This seems like a simple function, perhaps there is a solution out there.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33530419
Bad choice of words on my part.  I didn't mean to suggest that the items are no longer needed in the sense of ready to be thrown away.  

Archiving is specifically meant to take items offline, get them out of the mailbox to conserve space and reduce clutter.  I'm not aware of any means of archiving to the existing mailbox since that defeats the purpose of archiving.  A person doesn't archive paper files to the same filing cabinet the files are already in.  That aside, the only solutions I know of are to manually archive the items (i.e. the users moves them to the archive folder) or to write a macro that handles this.  
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 37

Accepted Solution

by:
Neil Russell earned 500 total points
ID: 33530777
OK, heres a MANUAL solution of a Macro. This MOVES all inbox item older than 60 days into a SUB FOLDER of INBOX called "Archived Mail"
Based on code found here.....   http://blogs.msdn.com/b/robert_mcmurray/archive/2010/02/25/outlook-macros-part-1-moving-emails-into-personal-folders.aspx

Sub MoveOldEmails()

    ' Declare all variables.
    Dim objOutlook As Outlook.Application
    Dim objNamespace As Outlook.NameSpace
    Dim objSourceFolder As Outlook.MAPIFolder
    Dim objDestFolder As Outlook.MAPIFolder
    Dim objVariant As Variant
    Dim lngMovedMailItems As Long
    Dim intCount As Integer
    Dim intDateDiff As Integer
    Dim strDestFolder As String
    
    ' Create an object for the Outlook application.
    Set objOutlook = Application
    ' Retrieve an object for the MAPI namespace.
    Set objNamespace = objOutlook.GetNamespace("MAPI")
    ' Retrieve a folder object for the source folder.
    Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderInbox)
    
    ' Loop through the items in the folder. NOTE: This has to
    ' be done backwards; if you process forwards you have to
    ' re-run the macro an inverse exponential number of times.
    For intCount = objSourceFolder.Items.Count To 1 Step -1
        ' Retrieve an object from the folder.
        Set objVariant = objSourceFolder.Items.Item(intCount)
        ' Allow the system to process. (Helps you to cancel the
        ' macro, or continue to use Outlook in the background.)
        DoEvents
        ' Filter objects for emails or meeting requests.
        If objVariant.Class = olMail Or objVariant.Class = olMeetingRequest Then
            ' This is optional, but it helps me to see in the
            ' debug window where the macro is currently at.
            Debug.Print objVariant.SentOn
            ' Calculate the difference in years between
            ' this year and the year of the mail object.
            intDateDiff = DateDiff("d", objVariant.SentOn, Now)
            ' Only process the object if it isn't this year.
            If intDateDiff > 60 Then ' <<<<<<< THE NUMBER OF DAYS
                ' Calculate the name of the personal folder.
                strDestFolder = "Archived Mail"
                ' Retrieve a folder object for the destination folder.
                Set objDestFolder = objNamespace.GetDefaultFolder(olFolderInbox).Folders(strDestFolder)
                ' Move the object to the destination folder.
                objVariant.Move objDestFolder
                ' Just for curiousity, I like to see the number
                ' of items that were moved when the macro completes.
                lngMovedMailItems = lngMovedMailItems + 1
                ' Destroy the destination folder object.
                Set objDestFolder = Nothing
            End If
        End If
    Next
    
    ' Display the number of items that were moved.
    MsgBox "Moved " & lngMovedMailItems & " messages(s)."

End Sub

Open in new window

0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 33541752
You could of course set this macro to fire everytime they open / close outlook and would to all intents and purpose then be automatic.
0
 

Author Closing Comment

by:arms145
ID: 33580301
Thanks for the script.  If no one knows any other way using a built-in feature, then I'll assume this is the best approach.  Outlook 2007 does have a new type of rule to move items older than a specific date, but oddly you can't specify older than a certain number of days, only a specific date, and they didn't improve on it in v2010.
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

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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