Last post Oct 10, 2012 11:50 AM by Dr. Acula
Oct 10, 2012 11:33 AM|Dr. Acula|LINK
I'm not sure if this is the right place to post this.
I am retrieving a list of items from a specific folder in a Mailbox, What I want to do is filter these items so I only get, for example, yesterday's messages. does anyone have any experience of this?
Oct 10, 2012 11:40 AM|javedwahid|LINK
I don't have any experience directly with Outlook.Items, but here's a suggestion
I would think that the Outlook.Items is returning some kind of List(Of MailItems) (I'm guessing here)
If you have a List(Of TYPE) you can do Outlook.Items.Where(Function (item) item.ReceievedDate = Today - 1 day)
Look up how to get yesterdays date.
Hopefully this gets you in the right direction.
Oct 10, 2012 11:50 AM|Dr. Acula|LINK
Thanks, I was looking for something like that, it just took me a while to figure it out as its not just a simple List, here's how I did it in the end
List<MailItem> lstMIs = OulookItems.Cast<MailItem>().Where(em => em.ReceivedTime > DateTime.Now.AddDays(-1)).ToList();