Rafael
Rafael

Reputation: 3196

using RDCOMClient to pull emails from a folder

I have a script to pull emails from a certain folder, however the number of emails being returned in R does not match how many emails are in the folder. I think Outlook or R is truncating the folder at a certain max size of items.

Is there any way around this?

OutApp <- COMCreate("Outlook.Application")
outlookNameSpace = OutApp$GetNameSpace("MAPI")

fld <- outlookNameSpace$GetDefaultFolder(6)
fld = fld$folders(fldr)
Cnt = fld$Items()$Count()
emails <- fld$items
emails()$Count()

## 319 vs 321

If I open that folder in Outlook I can see it's truncated: enter image description here

Is there anyway to increase this view in Outlook?

Upvotes: 3

Views: 436

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66341

You would need to open the folder in the online mode (Extended MAPI in C++ or Delphi, or Redemption (I am its author) in any language, including R) or you can either (a) turn cached mode off in the Exchange Account properties or make it sync all items instead of time-limited range.

Upvotes: 0

Related Questions