Can't receive new emails with RDCOMClient

Occasional Contributor

I'm trying to use R to load my emails from Outlook 365. Yesterday I tried this:

outlook_app <- COMCreate("Outlook.Application", existing = FALSE)
outlookNameSpace <- outlook_app$GetNameSpace("MAPI")
folder <- outlookNameSpace$GetDefaultFolder(6)
emails <- folder$Items
and it worked fine. When I ran the following code:

I could see the subject of the last email on my Inbox. Great!

However, I couldn't get any updates from that point. If I run the same code today, I get exactly the same emails than yesterday, eventhough I have new emails on my Inbox.

I tryed with and without the existing = FALSE option in COMCreate function, but with no success.

What I'm doing wrong? How can update the data with the new emails?

By the way, is there any good documentation or tutorial about using RDCOMClient with Outlook? I still can't get the logic of this library.


0 Replies