Home » Questions » Computers [ Ask a new question ]

Is it possible to create custom follow-up flags in Outlook 2007?

Is it possible to create custom follow-up flags in Outlook 2007?

The standard follow-up flags are: "Today", "Tomorrow", "This Week", "Next Week" and "No Date". I'd like to add another option to this list for "This Month".

Asked by: Guest | Views: 30
Total answers/comments: 1
Guest [Entry]

"Idea is simple - write your own VBA macro.

Here is a VBA code that will do the work (SetFollowupToMonthEndMacro is the macros that you can associate with a button or a hot-key combination)

Sub SetFollowupToMonthEndMacro()

Dim sel As Outlook.selection
Set sel = Application.ActiveExplorer.selection

Dim item As Object
Dim i As Integer

For i = 1 To sel.Count
Set item = sel.item(i)
If item.Class = olMail Then
Dim mail As MailItem
Set mail = item
mail.MarkAsTask (olMarkNoDate)
mail.TaskStartDate = SetLastDate(Now)
mail.Save
End If

Next i

End Sub

Private Function SetLastDate(pDate As Date) As Date
Dim iDay As Integer
iDay = Day(pDate)
Dim iLastDay As Integer
Select Case Month(pDate)
Case 1, 3, 5, 7, 8, 10, 12
iLastDay = 31
Case 4, 6, 9, 11
iLastDay = 30
Case 2
If (Year(pDate) Mod 4) = 0 Then
iLastDay = 29
Else
iLastDay = 28
End If
End Select

SetLastDate = DateAdd(""d"", iLastDay - iDay, pDate)

End Function

There is no way to setup this from settings or somehow else, without VBA programming, because, unfortunately, in internal Outlooks function MailItem.MarkAsTask(MarkInterval) MarkInterval parameter can have only one of OlMarkInterval Enumeration values

olMarkNoDate 4 Mark the task due with no date.
olMarkNextWeek 3 Mark the task due next week.
olMarkThisWeek 2 Mark the task due this week.
olMarkToday 0 Mark the task due today.
olMarkTomorrow 1 Mark the task due tomorrow.

So if internal function has the limitation, UI will naturally have the same limitation too."