Full path of Map file

766
2
Jump to solution
01-23-2012 06:25 PM
JohnMcGlynn
Occasional Contributor
Hi,

I am trying to get the full path of my currently open map. I can get the file name using IDocument.Title but finding the full path is a puzzle.

I tried getting the window handle and then using this to get the filename but kept getting 'Cannot Read/Write Protected Memory' errors.

Does anyone know how to get the full path of the currently open map file?

Thanks,

John
0 Kudos
1 Solution

Accepted Solutions
HenryColgate
Occasional Contributor
This works for Add-In reference, as long as you reference the appropriate Templates location.


ESRI.ArcGIS.Framework.ITemplates templates = ArcMap.Application.Templates;  System.Windows.Forms.MessageBox.Show(template.get_Item(template.Count - 1).ToString());

View solution in original post

0 Kudos
2 Replies
HenryColgate
Occasional Contributor
This works for Add-In reference, as long as you reference the appropriate Templates location.


ESRI.ArcGIS.Framework.ITemplates templates = ArcMap.Application.Templates;  System.Windows.Forms.MessageBox.Show(template.get_Item(template.Count - 1).ToString());
0 Kudos
JohnMcGlynn
Occasional Contributor
Thanks Henry, works beautifully.

John
0 Kudos