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); } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und vieles mehr. Neu hier? Erstelle kostenlos ein Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.