Search This Blog

Thursday 4 April 2013

Outlook 2003: Exclude Flagged Emails from Archiving

I use the follow up flags a lot it my job because with all the work going in and out it is a good way to keep track of the jobs you have left to do.
So... when outlook decides to archive off half of the jobs I have yet to complete it can be a real pain.
Also I don't want to turn archiving off because I don't want my inbox cluttered with emails that are no longer relevant.

Therefore I have created a solution using VBA.
The code needs to be copied and pasted into ‘ThisOutlookSession’ which can be found by pressing ‘ALT+F11’ then expanding the folders in the project window to the left.

It works by capturing when you flag a email and automatically sets the ‘Do Not Archive’ to Ticked.


Dim myOlApp As New Outlook.Application
Public WithEvents myOlItems As Outlook.Items

Private Sub Application_Startup()
    Set myOlItems = myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub myOlItems_ItemChange(ByVal Item As Object)
If Item.FlagStatus = OlFlagStatus.olFlagMarked And Item.NoAging = False Then
    Item.NoAging = True
    Item.Save
ElseIf Item.FlagStatus = OlFlagStatus.olNoFlag And Item.NoAging = True Then
Item.NoAging = False
    Item.Save
ElseIf Item.FlagStatus = OlFlagStatus.olFlagComplete And Item.NoAging = True Then
Item.NoAging = False
    Item.Save
End If
End Sub

2 comments:

  1. Turn of archiving and turn on a little personal organisation! :p

    ReplyDelete
    Replies
    1. [im]http://cdn.shopify.com/s/files/1/0173/4276/files/Ain-t-Nobody-Got-Time-Fo-Dat-sweet-brown-31241125-480-330_medium.jpg?2896[/im]

      Delete