RDCOMClient + Outlook email search using date in R

2019-09-03 04:20发布

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条回答
放我归山
2楼-- · 2019-09-03 04:47

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).

查看更多
登录 后发表回答