Solved

Outlook Auto Archive to Exchange folder

Posted on 2010-08-26
6
677 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

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.

Question has a verified solution.

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

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create an Address List 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 Organization >> Ad…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now