0

I am trying to search emails in the mail using RDCOM client in r.

i am not able to search the mails using date as filter.

I am getting all the mails present in my inbox when i use the code below

library(RDCOMClient)

outlook_app <- COMCreate("Outlook.Application")
search<-outlook_app$AdvancedSearch("Inbox","urn:schemas:mailheader:date = '2018-08-22 00:14:10 IST'")
results <- search$Results()
results$Count()

I tried searching for any good documentation on how to do it but i could not find any resource.

Can Anyone help me with this?

1 Answers1

0

You should never use "=" when working with dates: you can never get an exact match because of the round-off errors. Always use a range (prop > date1) and (prop < date2).

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thanks,I couldn't manage to get what i wanted even after changing the "=" to ">" and"<". But i found another way of doing it. – Himakund Mallampalli Aug 24 '18 at 07:57
  • @HimakundMallampalli How did you do it? The same question is being ask again today. https://stackoverflow.com/questions/56375203/rdcomclient-outlook-email-search-using-date-interval-in-r – Gainz May 30 '19 at 14:14