title: How get folder other than default folder of outlook using pywin32
body: <p>I try to make an alert mail report dashboard/report using python's pywin32 library(I'm new into this), 
  so I'm trying to fetch the details like time of an alert mail that has been set up in some different folder other than the default inbox folder(that is also a subfolder of a different folder altogether, which parent folder is not part of any default outlook folder).</p>
  
  <p><a href="https://i.stack.imgur.com/0Rakv.png" rel="nofollow noreferrer">My outlook folder</a></p>
  
  <pre><code>import sys, win32com.client, datetime
  # Connect with MS Outlook - must be open.
  outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
  
  # connect to Sent Items
  s = outlook.GetDefaultFolder(6).Items   # "5" refers to the sent item of a
  #s.Sort("s", true)
  # Get yesterdays date for the purpose of getting emails from this date
  d = (datetime.date.today() - datetime.timedelta (days=1)).strftime("%d-%m-%y, %H:%M:%S")
  # get the email/s
  msg = s.GetLast()
  # Loop through emails
  while msg:
      # Get email date 
      date = msg.SentOn.strftime("%d-%m-%y , %H:%M:%S")
      # Get Subject Line of email
      sjl = msg.Subject
      # Set the critera for whats wanted                       
      if d == date and (msg.Subject.startswith("XXXX ") or msg.Subject.startswith("XXXXX")):
          print(sjl,date) 
      msg = s.GetPrevious()
  </code></pre>
  
  <p>So by the above code I was only able to get the details of email which are in the default folder only (such as inbox/sent/..)</p>