Outlook Macro: Flag and Move Message to Follow-up Folder
As my readers know I follow many of the Getting Things Done methods and when it comes to e-mail I try (usually unsuccessfully) to keep my inbox uncluttered. In Outlook there is a great feature called Flags that will turn an e-mail into an item on the To-Do list without creating a task. Of course if you just flag it you will need to move it if you intend to keep your inbox clean.
To speed up the process of flagging and moving the message I have created the following scripts to move the task to a follow-up folder and flag if for start and completion the following work day. This allows me to review and schedule the task that are processed for follow-up after I have filed the items that need no further action.
I have created a button on the Outlook toolbar to perform this task on the select item but could easily modify the provided code to add additional subroutines that would flag or categorize the items in an infinite number of combinations.
To use the following code just copy and paste it into the macros in Outlook 2007:
Sub FlagSelectedMessageForFollowUpAndMove()
On Error Resume Next Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem
FlagForFollowUpNextWeekday
Set objNS = Application.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
'Note to users *** You need to change the folder name and it must be a sub-folder of the inbox
Set objFolder = objInbox.Folders("Follow-up Issues")
'Assume this is a mail folder
If objFolder Is Nothing Then MsgBox "This folder doesn't exist!", vbOKOnly + vbExclamation, "INVALID FOLDER" End If
If Application.ActiveExplorer.Selection.Count = 0 Then 'Require that this procedure be called only when a message is selected Exit Sub End If
For Each objItem In Application.ActiveExplorer.Selection If objFolder.DefaultItemType = olMailItem Then If objItem.Class = olMail Then objItem.Move objFolder End If End If Next
Set objItem = Nothing Set objFolder = Nothing Set objInbox = Nothing Set objNS = Nothing
End Sub
Sub FlagForFollowUpNextWeekday() 'Based on code presented at: http://skillzdesign.com/blog/2008/01/02/flag-microsoft-outlook-inbox-items-for-follow-up-script/
Dim Days As Integer
Dim DayOfWeek As Integer
Days = 1
DayOfWeek = DatePart("w", Now() + Days)
Do Until (DayOfWeek > 1 And DayOfWeek < 7)
Days = Days + 1
DayOfWeek = DatePart("w", Now() + Days)
Loop
FlagForXDays Days, "Follow Up", "@NotAssigned"
End Sub
Sub FlagForXDays(intDays As Integer, strFlagRequest As String, strCategories) 'Based on code presented at: http://skillzdesign.com/blog/2008/01/02/flag-microsoft-outlook-inbox-items-for-follow-up-script/ 'Modified by Marc Rohde (http://marc.rohde-net.us) to the flag by a number of days. Dim Item As Object Dim SelectedItems As Selection Dim dtTaskDate As Date dtTaskDate = CStr(CDate(Format(CDbl(Now) + intDays))) Set SelectedItems = Outlook.ActiveExplorer.Selection For Each Item In SelectedItems With Item .ToDoTaskOrdinal = dtTaskDate .TaskDueDate = dtTaskDate .TaskStartDate = dtTaskDate .FlagStatus = 2 .FlagRequest = strFlagRequest .Categories = strCategories .FlagIcon = 6 .Save End With Next Item End Sub
Related posts:
- E-Mail Managment Best Practices Regular blog readers will notice that e-mail and task managment...
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=9b4d36b7-0bda-46d9-9663-cca1e0909c16)







I know this post is about tweaking Outlook to do GTD, however, you might want an easier way with an all electronic system built for GTD.
I found an application that allows me to view my entire GTD at work on my Win machine, at home on my Macs and even on my cell phone. And another app lets me call in tasks to my GTD without any writing or typing, great for those thoughts that hit me while driving. I’ve written about my experiences with GTD in a blog post at http://johnkendrick.wordpress.com/2008/03/27/more-getting-things-done/ John