title: How to iterate through every mail item in every folder, Outlook Add-in 2010
body: <p>This is what I've got so far, (not working)</p>
  
  <pre><code>private void ScanAllMailItems()
  {
      Outlook.Folders folders = _outlookNameSpace.Folders;
      foreach (Outlook.Folder folder in folders)
      {
          foreach (Outlook.MailItem m in folder.Items)
          {
              ScanMailBody(m);
          }
      }
  }
  </code></pre>
  
  <p>There is no exception, it seems folder.items is always empty. 
  The outlook mailbox itself has 10 folders each with between 20-300 mail</p>