Outlook macro: custom follow-up flag for multiple selected emails

garoe 1 Reputation point
2021-01-25T21:26:03.86+00:00

I found a code which I have been able to adapt to almost get me to where I want to; I want to be able to select multiple emails, then click a button to run a macro to set the flag follow up date to X days from now. The below code works for a single selected email, but how can I get this code to work for several selected emails (or is there a better code to use to achieve this)?

Sub Set_3DaysFollowUp()

    Dim numDays As Double
    Dim uPrompt As String
    Dim MyMailItem As Object

    On Error Resume Next
    If ActiveInspector.CurrentItem.Class = olMail Then
        Set MyMailItem = ActiveInspector.CurrentItem
    End If

    If (ActiveExplorer.Selection.Count = 1) And _
          (ActiveExplorer.Selection.item(1).Class = olMail) Then

            Set MyMailItem = ActiveExplorer.Selection.item(1)

    End If

    MyMailItem.TaskDueDate = Now + 3
    MyMailItem.FlagRequest = "Follow up"

    MyMailItem.Save

End Sub
0 comments No comments
{count} votes