I am trying to move tasks from the To-Do list to an "Inquiries" Task folder.
Preferably it should move the task without having to select it.
This code gives me:
'Runtime Error '424' Object Required'
Original code from https://www.slipstick.com/outlook/macro-move-folder/
Sub MoveTask()
 
    Dim objOutlook As Outlook.Application
    Dim objNamespace As Outlook.NameSpace
    Dim objSourceFolder As Outlook.MAPIFolder
    Dim objDestFolder As Outlook.MAPIFolder
    Dim objItem As TaskItem
    Dim strSignifier As String
     
    Set objOutlook = Application
    Set objNamespace = objOutlook.GetNamespace("MAPI")
    Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderTasks)
    Set objItem = objFolder.Items.Add(olTaskItem) ' this line has the error
    Set objDestFolder = objNamespace.GetDefaultFolder(olFolderTasks).Folders("Inquiries")
 
    strSignifier = "#CT-"
 
    If Left(Item.subject, Len(strSignifier)) = strSignifier Then
        objItem.Move objDestFolder
    End If
               
    Set objDestFolder = Nothing
End Sub
 
     
    