I need to get hold of ArcMap properties in order to change the data source of the layers within it.
I have developed a similar utility earlier utilizing ICommand, but I was curious if I could get a reference to ArcMap application outside of it and change the layer sources and display the new map.
I am using the following code but it instantly launches ArcMap and after that I have no hold on the application i.e. if I terminate my application, ArcMap is still running in background.
Is it possible to get a silent, invisible reference to ArcMap?
Thanks in advance!
IApplication pApp;
IDocument pDoc;
IMxDocument pMxDoc;
string MXDPath = "C:\\NORMALTEMPLATE\\OLD_Normal.mxd";
pDoc = new MxDocumentClass(); //ArcMap launches here
pApp = pDoc.Parent;
pApp.OpenDocument(MXDPath);
MessageBox.Show("Doc opened");

