Outlook 2010 - View.Filter - Filtering mail items by Received date programatically using C# .NET4.0 VS2010 RRS feed

  • Question

  • Hi,

    I am working on a Outlook 2010 Add-In using Visual Studio 2010 and .NET Framework 4.0 on a Windows 7 64bit Machine.

    Programatically filter the Mail Items in a Folder using the View.Filter property, which were Received on a particular date

    I tried the following code (Please correct me if i’m wrong)

    Outlook.Application thisApp = this.Application;
    Outlook.Explorer thisExp = thisApp.ActiveExplorer();
    Outlook.MAPIFolder thisFolder = thisExp.CurrentFolder;
    string query = “\”urn:schemas:httpmail:datereceived\” = ’12/9/2009 2:08 PM’”;
    thisFolder.CurrentView.Filter = query;

    But it is not returning any mail item, even though there are mails which were received on this [12/9/2008 2:08 PM] particular time.

    Please help me out with this. URGENT!!!!

    Thanks in Advance
    Monday, August 19, 2013 8:49 AM