title: Python - Get list of all attributes/properties of a win32com class
body: <p>I am a newbie in Python. I have to extract emails from Outlook and get all attributes/properties of the emails.</p>
  
  <p>Retrieving properties one by one, for the attributes/properties that I know they exist works fine (.Subject, .Body, etc.).</p>
  
  <p>But, I need to get all possible attributes. That's where my problem is.
  I have been looking for hours, the only answers I found were using:</p>
  
  <p><ul>
  <li>vars()</li>
  <li>dir()</li>
  <li>inspect.getmembers(obj)</li>
  <li><code>__dict__</code></li>
  <li>etc.</ul></li>
  
  Which does not give me the list of properties like:</p>
  
  <p><ul>
  <li>.Subject</li>
  <li>.Body</li>
  <li>.SentOn</li>
  <li>etc.</ul></li>
  
  Could someone help ?</p>
  
  <p>Here is the extract of my test Notebook :</p>
  
  <pre><code>####### Retrieve email from Outlook #######
  import win32com.client
  objOutlookMAPI=win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
  ​    
  ​### Define folder
  objOlFolder = objOutlookMAPI.GetDefaultFolder(6)
  
  ​### Retrieve ant print email
  objOlMessages = objOlFolder.Items
  ​
  # objMessage : class 'win32com.client.CDispatch'
  objMessage = objOlMessages.GetLast()
  print(objMessage.Subject)    
  
  &gt; Are you going to Las Vegas for Black Hat, DefCon, Bsides, or Hacking Diversity? Either or join us on our adventures!
  
  vars(objMessage)
  
  &gt; {'_builtMethods_': {},
   '_enum_': None,
   '_lazydata_': (&lt;PyITypeInfo at 0x0000021EC7B7D170 with obj at 0x0000021EC7B4B2F8&gt;,
    &lt;PyITypeComp at 0x0000021EC7B7D620 with obj at 0x0000021EC7B4B058&gt;),
   '_mapCachedItems_': {},
   '_oleobj_': &lt;PyIDispatch at 0x0000021EC7B7D290 with obj at 0x0000021EC7B4AAA8&gt;,
   '_olerepr_': &lt;win32com.client.build.LazyDispatchItem at 0x21ec8a7ba90&gt;,
   '_unicode_to_string_': None,
   '_username_': 'GetLast'}
  
  
      dir(objMessage)
      #import inspect
      #inspect.getmembers(objMessage)
  
  &gt; [`'_ApplyTypes_'`,
   `'_FlagAsMethod'`,
   `'_LazyAddAttr_'`,
   `'_NewEnum'`,
   `'_Release_'`,
   `'__AttrToID__'`,
   `'__LazyMap__'`,
   `'__bool__'`,
   `'__call__'`,
   `'__class__'`,
   `'__delattr__'`,
   `'__dict__'`,
   `'__dir__'`,
   `'__doc__'`,
   `'__eq__'`,
   `'__format__'`,
   `'__ge__'`,
   `'__getattr__'`,
   `'__getattribute__'`,
   `'__getitem__'`,
   `'__gt__'`,
   `'__hash__'`,
   `'__init__'`,
   `'__init_subclass__'`,
   `'__int__'`,
   `'__le__'`,
   `'__len__'`,
   `'__lt__'`,
   `'__module__'`,
   `'__ne__'`,
   `'__new__'`,
   `'__reduce__'`,
   `'__reduce_ex__'`,
   `'__repr__'`,
   `'__setattr__'`,
   `'__setitem__'`,
   `'__sizeof__'`,
   `'__str__'`,
   `'__subclasshook__'`,
   `'__weakref__'`,
   `'_builtMethods_'`,
   `'_enum_'`,
   `'_find_dispatch_type_'`,
   `'_get_good_object_'`,
   `'_get_good_single_object_'`,
   `'_lazydata_'`,
   `'_make_method_'`,
   `'_mapCachedItems_'`,
   `'_oleobj_'`,
   `'_olerepr_'`,
   `'_print_details_'`,
   `'_proc_'`,
   `'_unicode_to_string_'`,
   `'_username_'`,
   `'_wrap_dispatch_'`]
  </code></pre>