Outlook Macro to Move Copy of Task Item

I have Outook 2010.  I need a macro to take my task, make a copy of it and then move the COPY into another task folder.

I have everything working except it moved the original task into the folder and not the copy of the task.

Here is my code:
Sub CopyTaskDDS()
    'Check how many items need to create tasks
    Select Case TypeName(Outlook.Application.ActiveWindow)
    Case "Inspector"
        CreateTaskfromObject Outlook.Application.ActiveInspector.CurrentItem
    Case "Explorer"
        Dim objItem As Object
        For Each objItem In Outlook.Application.ActiveExplorer.Selection
            CreateTaskfromObject objItem
        Next
    End Select
End Sub
Sub CreateTaskfromObject(objItem As Object)
' NOTE - This code uses CopyTaskDDS
Dim objTask As Outlook.TaskItem
Select Case objItem.Class
Case olTask
  ' Duplicate the task (DDS)
    Dim objMainTask As TaskItem
    Set objTask = Application.CreateItem(olTaskItem)
    Set objMainTask = objItem
    Set objTask = objMainTask.Copy
    With objTask
        .Subject = "DDS of " & .Subject
        .Save
    End With
End Select
'Move the Task
 Dim Ns As Outlook.NameSpace
 Dim oApp As Outlook.Application
 Dim oTask As Outlook.TaskItem
 Dim moveTo As Outlook.Folder

Set Ns = Application.GetNamespace("MAPI")
 Set oApp = Outlook.Application
'If task is open, this will move the task to a subfolder of the default tasks folder:
 Set oTask = oApp.ActiveInspector.CurrentItem
 
 Set moveTo = Ns.GetDefaultFolder(olFolderTasks).Folders("DDS Tasks")
 oTask.Move moveTo
 End Sub
 
I realize the reason it's moving the original task item is because of my code "Set oTask = oApp.ActiveInspector.CurrentItem", but I'm not sure what to code to tell it to move the Copied Task Item.

Can anyone assist me.

Thank you in advance.
Senniger1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omgangIT ManagerCommented:
You still have a reference (in your procedure) to the copy of the task --- objTask.  Instead of moving oTask (the current item), try moving the copy

'oTask.Move moveTo
objTask.Move moveTo

OM Gang
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Senniger1Author Commented:
Perfect!  Absolutely what I needed.  Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.