Link to home
Start Free TrialLog in
Avatar of rrhandle8
rrhandle8Flag for United States of America

asked on

Outlook VBA not all emails moved

Each time I run this code, only some emails are moved.  I have to run it 3 to 5 times to get all of them moved.

 For Each oItem In oFolder.Items
    If TypeName(oItem) = "MailItem" Then
        If Left(oItem.Subject, 31) = "Information about your order (#" And oItem.ReceivedTime > #11/23/2014# Then
            oItem.Move oDestFolder
            Debug.Print oItem.Subject
        End If
    End If
 Next

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Simon
Simon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial