chaitanyap

Save Mxd Document using C# code

Discussion created by chaitanyap on Apr 24, 2013
Latest reply on Apr 25, 2013 by scjpike
Hi My requirement is to Open an Arc map application and close it automatically through C# coding.

For that I Wrote below code

IDocument pDoc = new MxDocumentClass();
                pApp = pDoc.Parent;
                pApp.OpenDocument(sMxdFileName);

                if (pApp != null)
                {
                  
                    pApp.Shutdown(); 
                 }
  // pApp.saveDocument is not working

Everything is fine , But before  shutdown statement is executing , In Map same dialog box like save changes to Mxd and Yes or No Buttons are avaialble there. We should able to handle that control also through coding before execute the Shutdoen statement.i.e we should close the document opened with affected changes.

can u please suggest me the code for that

Outcomes