>Hi,
>
>I have the following code to move all the emails sent to
information@abc.com to the oNewFolder folder
>
>When I run the following code each time, only about half of the total mails sent to this address are moved to the destinated folder, not all.
>Can any one solve this problem for me. Thanks.
>
>******************************************************************
>
>myRestrictedItems = myItems.restrict("[To] =
information@abc.com")
>
>for each myRestrictedItem in myRestrictedItems
> loReply = myRestrictedItem.Reply
> lcSender = loReply.Recipients[1].Address
> ?lcSender
>
> myRestrictedItem.move(oNewFolder)
>endfor
>
>*******************************************************************
>
>Mun
(disclaimer on) I have not worked with Outlook objects, but I have worked with MS Word application objects. (disclaimer off)
Perhaps the difficulty lies in the For loop iterating through the collection while the number of items changes because of the move command. Try commenting out the move command line to see if the loop without the move can iterate through the whole collection. If so, then you at least have a better understanding of the problem.
-Lou.
"All my life I said I wanted to be someone ...
I can see now that I should have been more specific." -Jane Wagner