title: Counting Mails in Outlook with Autohotkey
body: <p>I tried to write a script, that counts the e-Mails in a specific public exchange folder in outlook.
  If there are Mails in subfolder2, a Messagebox should open and tell me, how many Mails there are. I tried this, but it did not work.</p>
  
  <pre><code>    Outlook := ComObjActive("Outlook.Application")
      mail = (Outlook.Application.ActiveExplorer().Session.GetDefaultFolder(18).Folders("Subfolder\Subfolder2")
      if (mail.Items.Count&gt;0)
      {
      msgbox % mail.Items.Count "Mails in folder"
      }
      else
      {
      msgbox No Mails.
      }
  </code></pre>
  
  <p>Does anyone has a idea, how I should change the script, that it works?</p>