To All,
From a Microsoft Forum, I was told to change the objItem as a mailItem to a ReportItem and it now works perfectly and to all here is the full code that works:
Sub MoveSelectedMessagesToFolderUndeliveredEmails()
Dim objFolder As outlook.MAPIFolder, objInbox As outlook.MAPIFolder
Dim objNS As outlook.NameSpace, objItem As outlook.ReportItem
Dim olReport
Dim olMail
Set objNS = Application.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
On Error Resume Next
Set objFolder = objInbox.Folders("Undelivered E-Mails")
'Assume this is a mail folder
If objFolder Is Nothing Then
MsgBox "This folder doesn’t exist!", vbOKOnly + vbExclamation, "INVALID FOLDER"
End If
If Application.ActiveExplorer.Selection.Count = 0 Then
'Require that this procedure be called only when a message is selected
Exit Sub
End If
For Each objItem In Application.ActiveExplorer.Selection
objItem.Move objFolder
Next
Set objItem = Nothing
Set objFolder = Nothing
Set objInbox = Nothing
Set objNS = Nothing
End Sub