I am trying to find the path name of the current ArcMap document that the python script is currently running in.

For Example:


I tired using


as shown here

Finding script location... dynamically

but this gives me the path of the python script not the .mxd

Any thoughts?

  • I'll be interested to see any Answers because there seems to be no property on the MapDocument object (help.arcgis.com/en/arcgisdesktop/10.0/help/00s3/…) that would help you
    – PolyGeo
    Commented May 16, 2012 at 22:32
  • Actually I think there is: Does MapDocument.filePath return the expected value?
    – blah238
    Commented May 16, 2012 at 22:42
  • Yes that worked. mxd = arcpy.mapping.MapDocument("CURRENT") textElement.text = mxd.filePath Commented May 16, 2012 at 22:46

1 Answer 1


Try MapDocument.filePath:

>>> mxd = arcpy.mapping.MapDocument("CURRENT")
>>> mxd.filePath

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.