<?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: Notifying ArcMap document to save persistent data for Add-in in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/notifying-arcmap-document-to-save-persistent-data/m-p/9638#M237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need to set the document save flag by calling IDocumentDirty2.SetDirty.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 13:11:18 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2010-11-17T13:11:18Z</dc:date>
    <item>
      <title>Notifying ArcMap document to save persistent data for Add-in</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/notifying-arcmap-document-to-save-persistent-data/m-p/9637#M236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm working on an Add-in (using C#) that needs to store some information in the MXD. I got that working successfully using the concepts outlined in the "Persisting data by implementing an extension using add-ins" topic in the SDK Help. However, unless the user saves the document, the changes aren't written (of course). Looking for a way to notify ArcMap that the document needs to be saved, the only thing I could find that works is calling:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcMap.Document.UpdateContents();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;once for each document session if the data I am storing changes. If I do that, then ArcMap will prompt the user to save if necessary when closing the document -- which is exactly what I want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this the correct method to use?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This was kind of a guess, since I could not find any other posts or samples about this subject. The documentation for the UpdateContents() method only states:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Notifies the document that the contents have been updated."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Refreshes the current view in the table of contents. UpdateContents is a shortcut - it calls Refresh on the current contents view (IContentsView::Refresh)."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was enough to give it a try, but it would be nice if the documentation was more explicit about it producing a "save" prompt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 21:17:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/notifying-arcmap-document-to-save-persistent-data/m-p/9637#M236</guid>
      <dc:creator>JeffreyHamblin</dc:creator>
      <dc:date>2010-11-16T21:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying ArcMap document to save persistent data for Add-in</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/notifying-arcmap-document-to-save-persistent-data/m-p/9638#M237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need to set the document save flag by calling IDocumentDirty2.SetDirty.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 13:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/notifying-arcmap-document-to-save-persistent-data/m-p/9638#M237</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2010-11-17T13:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying ArcMap document to save persistent data for Add-in</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/notifying-arcmap-document-to-save-persistent-data/m-p/9639#M238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for the information, Neil. That's exactly what I wanted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I searched the ArcObjects SDK in the Resource Center for every term I could think of, and did not find that. I should have tried "dirty".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 16:23:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/notifying-arcmap-document-to-save-persistent-data/m-p/9639#M238</guid>
      <dc:creator>JeffreyHamblin</dc:creator>
      <dc:date>2010-11-17T16:23:40Z</dc:date>
    </item>
  </channel>
</rss>

