title: How to read the top 3(the latest) threads present in an email using python
body: <p>I was able to parse through the emails body that is present in a particular directory but it is trying to read all the threads the email has. The code I used to read the files from a directory is as follows. How to get only the top 3 threads present in an email.</p>
  
  <pre><code>#reading multiple .msg files using python
  from pathlib import Path
  import win32com.client
  outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
  # Assuming E:\emails\ is the directory containg files
  for p in Path(r'E:\emails\').iterdir():
      if p.is_file() and p.suffix == '.msg':
          msg = outlook.OpenSharedItem(p)
          print(msg.Body)
          print('-------------------------------')
  </code></pre>