Is This Content Helpful?
We're glad to know this article was helpful.
Instructions provide sample code which allows the current ArcMap document to close without prompting the user whether to save edits to the document file.
This code can be added to a map document or a template. Adding it to a template means it will be used by all MXD files based on the template.
Code in the Project's ThisDocument code module will only run in the current map document. If you want to store the code in all your map documents open the Normal.mxt ThisDocument code module instead.
Private Function MxDocument_BeforeCloseDocument() As Boolean
Dim pdoc As IMxDocument
Set pdoc = ThisDocument
Dim pdirty As IDocumentDirty2
Set pdirty = pdoc
When using either an MXD or MXT containing this code, ArcMap will not prompt whether changes should be saved when the application closes.