I currently have the below VBA code which has the following issue: once I move the msg to the subfolder the For Next loop will not then go to the next msg in the original Outlook folder.
If I take out the
msg.move olInboxFolder.Folders("Forms to do").Folders("Forms completed")
line of code it does work. So this line seems to be the issue.
Dim msg as MailItem
Dim olSubFolder As MAPIFolder
Set olSubFolder = olInboxFolder.Folders("Forms to do")
For Each msg In olSubFolder.Items ' for each message in the subfolder
'Do stuff
msg.move olInboxFolder.Folders("Forms to do").Folders("Forms completed")
Next msg
Has anyone any ideas on how to resolve this?
Thanks in advance.