Solved

Outlook Auto Archive to Exchange folder

Posted on 2010-08-26
6
680 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
[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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 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