I have a macro that sorts and moves mail into a subfolders according to category. I now want subfolders within the subfolders but I don't know how to write the instruction to move the mail - in this case 1st subfolder is AGENDA 05 MANAGEMENT then 2nd subfolder of 1st subfolder is PROJECTS 5.2 JOB REDESIGN:
If InStr(objItem.Categories, "AGENDAS 05 MANAGEMENT") > 0 Then
Set MyItem = objItem.Copy
MyItem.Move FolderInbox.Folders("AGENDAS 05 MANAGEMENT")
cMAILS.Add objItem.EntryID
End If
If InStr(objItem.Categories, "PROJECTS 5.2 JOB REDESIGN") > 0 Then
Set MyItem = objItem.Copy
MyItem.Move FolderInbox.Folders("PROJECTS 5.2 JOB REDESIGN")
cMAILS.Add objItem.EntryID
End If
I get an error message on the second instruction
If InStr(objItem.Categories, "AGENDAS 05 MANAGEMENT") > 0 Then
Set MyItem = objItem.Copy
MyItem.Move FolderInbox.Folders("AGENDAS 05 MANAGEMENT")
cMAILS.Add objItem.EntryID
End If
If InStr(objItem.Categories, "PROJECTS 5.2 JOB REDESIGN") > 0 Then
Set MyItem = objItem.Copy
MyItem.Move FolderInbox.Folders("PROJECTS 5.2 JOB REDESIGN")
cMAILS.Add objItem.EntryID
End If
I get an error message on the second instruction