none
What is correct way to do an Outlook Advanced Search for email with received or sent dates later than a particular time? RRS feed

  • Question

  • We have an Outlook Add-in where we need to search for "new" emails ... those that have been received (or sent) after the last search.  I'm currently using the following for a filter:

    ""urn:schemas:httpmail:date" >= '5/15/2014 1:12:21 PM'"

    where the time show in the example is the time the prior check began.  It appears that some emails are not found ... this is especially true for users in New Zealand where nothing is found.  My workaround has been to extend the begin time of the search an additional 24 hours ... and this works.  However, a lot of emails get checked again ... and again ... and again.

    Is there a better way to do this search???


    mdpowers

    Thursday, May 15, 2014 8:24 PM

Answers

  • If you specify property name in the DASL format, date time property value is assumed to be in the UTC time zone.

    You need to convert the value to UTC using PropertyAccessor.LocalTimeToUTC.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by mdpowers-slo Thursday, May 15, 2014 9:26 PM
    Thursday, May 15, 2014 8:49 PM

All replies

  • If you specify property name in the DASL format, date time property value is assumed to be in the UTC time zone.

    You need to convert the value to UTC using PropertyAccessor.LocalTimeToUTC.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by mdpowers-slo Thursday, May 15, 2014 9:26 PM
    Thursday, May 15, 2014 8:49 PM
  • As is most often the case, you are the one with the answer!  Thanks muchly, Dmitry!

    Now I gotta remember how to use PropertyAccessor ... I've got it somewhere!


    mdpowers

    Thursday, May 15, 2014 9:26 PM