title: R, RDCOMClient and Outlook: Access inbox messages with shared addresses
body: <p>I have several inboxes in Outlook: my.name@abc.com, plus a number of shared inboxes like team.data@abc.com for example, or team.ba@abc.com. </p>
  
  <p>By following <a href="https://stackoverflow.com/a/42590894/5224236">this method</a> I am trying to access the emails in my own inbox.</p>
  
  <p>The problem is that sometimes, the inbox accesses mails to my.name@abc.com, sometimes it can be any of the others! I've gone through the Omegahat explanations, but their example is mostly focused on excel, and I have no VB experience.</p>
  
  <p>I would like to define which inbox to retrieve the mails from.. My code so far (with the problem of varying inboxes). Cheers.</p>
  
  <pre><code>OutApp &lt;- COMCreate("Outlook.Application")
  outlookNameSpace = OutApp$GetNameSpace("MAPI")
  folder &lt;- outlookNameSpace$Folders(1)$Folders(folderName)
  folder$Name(1)
  emails &lt;- folder$Items
  for (i in 1:10)
  {
    subject &lt;- emails(i)$Subject(1)
      print(emails(i)$Subject()) 
  }
  </code></pre>
  
  <p>edit: I am running MSOffice Pro Plus 2016</p>
  
  <p>related: <a href="https://stackoverflow.com/q/49440262/5224236">How to use RDCOMClient to send Outlook email from a secondary account - translate existing VBA code?</a></p>