title: How to apply "WithEvents" trigger?
body: <p>I have this code in a module:</p>
  
  <pre><code>Private WithEvents objNewMailItems As Outlook.Items
  
  Public Sub Application_Startup()
      Dim olApp As Outlook.Application
      Dim objNS As Outlook.NameSpace
  
      Set olApp = Outlook.Application
      Set objNS = olApp.GetNamespace("MAPI")
  
      Set mainInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
  End Sub
  
  Private Sub mainInboxItems_ItemAdd(ByVal item As Object)
      Call MandarMail.sendOutlookEmail
      ' //this send another email...
  End Sub
  </code></pre>
  
  <p>This is my first time using a trigger. Visual Basic for Applications does not recognize this:</p>
  
  <pre><code>Private WithEvents objNewMailItems As Outlook.Items
  </code></pre>
  
  <p>I'm using Outlook 2013</p>