<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to display absolute file path of .mxd document in a message box in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41156#M1072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ITemplates templates = application.Templates;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return templates.get_Item(templates.Count - 1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason you are getting null values with the examples you've given is that you're trying to cast to IMapDocument but the objects implement the IDocument interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e. IDocument mapDoc = m_application.Document as IDocument;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;should not be null (unless m_application is null or you've not loaded a document)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Aug 2010 07:14:26 GMT</pubDate>
    <dc:creator>AndrewMay</dc:creator>
    <dc:date>2010-08-17T07:14:26Z</dc:date>
    <item>
      <title>How to display absolute file path of .mxd document in a message box</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41152#M1068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a command (developed using .NET SDK) in ArcMap, on clicking it should display absolute file path of that .mxd document in a message box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Muzammil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 07:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41152#M1068</guid>
      <dc:creator>MuzammilAK</dc:creator>
      <dc:date>2010-08-15T07:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to display absolute file path of .mxd document in a message box</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41153#M1069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i don't know if it's what you are looking for, but IMapDocument.DocumentFileName give you the mxd path.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Vincent&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Aug 2010 14:19:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41153#M1069</guid>
      <dc:creator>vincentLahaye</dc:creator>
      <dc:date>2010-08-15T14:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to display absolute file path of .mxd document in a message box</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41154#M1070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Muzammil&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check this interface: &lt;/SPAN&gt;&lt;A href="http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriFramework/ITemplates.htm"&gt;http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriFramework/ITemplates.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have Fun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mody&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Aug 2010 04:09:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41154#M1070</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2010-08-16T04:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to display absolute file path of .mxd document in a message box</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41155#M1071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Vincent,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried your suggestion in following ways, but neither of it works. When tried to cast its always null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Here mapDoc is always null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IMapDocument mapDoc = ((IMxDocument)m_application.Document).FocusMap as IMapDocument;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Here also, mapDoc is always null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IMapDocument mapDoc = m_application.Document as IMapDocument;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please suggest some sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Muzammil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Aug 2010 06:47:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41155#M1071</guid>
      <dc:creator>MuzammilAK</dc:creator>
      <dc:date>2010-08-17T06:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to display absolute file path of .mxd document in a message box</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41156#M1072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ITemplates templates = application.Templates;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return templates.get_Item(templates.Count - 1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason you are getting null values with the examples you've given is that you're trying to cast to IMapDocument but the objects implement the IDocument interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e. IDocument mapDoc = m_application.Document as IDocument;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;should not be null (unless m_application is null or you've not loaded a document)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Aug 2010 07:14:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-absolute-file-path-of-mxd-document/m-p/41156#M1072</guid>
      <dc:creator>AndrewMay</dc:creator>
      <dc:date>2010-08-17T07:14:26Z</dc:date>
    </item>
  </channel>
</rss>

