Solved

Outlook Auto Archive to Exchange folder

Posted on 2010-08-26
6
681 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
Independent Software Vendors: 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
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…

737 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