title: List field names of layer in MXD file
body: <p>I have an ArcMap file (.MXD) that I want to search for its layers and then pick a layer and have Python show me the field names of the attribute table of that layer.</p>
  
  <p>I have gotten so far that Python (ArcPy) lists me the layer names of the mxd but I cannot figure out how to get the field names.</p>
  
  <p>In ArcMap itself I can easily do it this way:</p>
  
  <pre><code>fields = arcpy.ListFields(Layer)
  for field in fields:
      print field.name
  </code></pre>
  
  <p>but how do I accomplish that outside of ArcMap through an MXD file? I have searched a lot and came up with nothing, so I am looking forward to your help! Thanks a lot!</p>