IDocument pDoc = null; IApplication pApp = null; try { pDoc = new MxDocumentClass(); pApp = pDoc.Parent; pApp.OpenDocument(sMxdFileName); // save file IMapDocument mapDoc = (IMapDocument)pDoc; mapDoc.Save(true, true); // suppress "do you want to save dialog" IDocumentDirty2 dirty = (IDocumentDirty2)pDoc; dirty.SetClean(); } finally { if (pDoc != null) { Marshal.ReleaseComObject(pDoc); } if (pApp != null) { pApp.Shutdown(); Marshal.ReleaseComObject(pApp); } }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.