How can I move copy of emails I flag and put them in a folder?
For example, John Doe sends me an email, I flag it, the original email stays in my inbox but a copy of the email goes into a folder called "Follow Up"
. Can someone help me?
EDIT:
The code below is extremely close to what I want but it's moving the original email to the folder instead of a copy. It's also not targeting the flagged email.
Sub FollowUp()
On Error Resume Next
Dim ns As Outlook.NameSpace
Dim moveToFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem
Set ns = Application.GetNamespace("MAPI")
'Define path to the target folder
Set moveToFolder = ns.Folders("MainFolder").Folders("Inbox").Folders("Follow Up")
If Application.ActiveExplorer.Selection.Count = 0 Then
MsgBox ("No item selected")
Exit Sub
End If
If moveToFolder Is Nothing Then
MsgBox "Target folder not found!", vbOKOnly + vbExclamation, "Move Macro Error"
End If
For Each objItem In Application.ActiveExplorer.Selection
If moveToFolder.DefaultItemType = olMailItem Then
If objItem.Class = olMail Then
objItem.Move moveToFolder
End If
End If
Next
Set objItem = Nothing
Set moveToFolder = Nothing
Set ns = Nothing
End Sub