I am running the following code to move all emails with the category 'File' to another specified folder. The issue I am experiencing is that when the code is executed, not all of the emails within the folder (inbox) are moved, even though the FOR loop is run through all the objects within the 'inbox' folder.
Once the code is executed several times, it does move the desired emails. Any suggestions on why this is occurring?
Set objFolder = Outlook.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
For Each objItems In objFolder.Items
If (objItems.Class = olMail) Then
If (objItems.Categories = "File") Then