title: How to connect to a specific email account on Outlook 2016 VBA using Rest API (Not MAPI)
body: <p>I am currently using Windows 7, Outlook 2010 with Exchange MAPI accounts.
  Several users have their personal account + several generic accounts (some with full access, some read only)
  The users execute a macro in VBA to connect to a specific mail adress/account to read check the incoming mails from the inbox on different criteria.</p>
  
  <p>This code snipet connects to the MAPI Account and sets the folder to the inbox of a mail account:</p>
  
  <pre><code>Dim ns As Outlook.NameSpace
  Dim Inbox As Outlook.Folder
  Set ns = GetNamespace("MAPI")
  Set Inbox = ns.Folders.Item("jon.doe@example.com").Folders("Inbox")
  </code></pre>
  
  <p>Now the IT decided to upgrade their servers to Exchange 2016. 
  Those account will not use <code>MAPI</code>. IT said they now use <code>REST API</code>. </p>
  
  <p>I suppose that's why I now receive this error message, when executing the code above with Outlook and Exchange 2016 and now Windows 10. 
  <img src="https://i.stack.imgur.com/IVJ6k.png" alt="VBA Runtime Error"></p>
  
  <p>I found online several solutions, but all of them need Visual Studio + Addins/Libraries. I want to do this with VBA and also connect to a mail account and inbox, so without Visual Studio, C#.</p>
  
  <p>Best regards</p>
  
  <p>Janko</p>