Open new ArcMap instance from ArcMap addin form

2238
2
08-11-2011 02:47 PM
OlwynBruce
New Contributor III
Hi there,
I'm trying to create a new ArcMap instance (ie. open a map in a separate ArcMap window) once a user clicks a button on an addin form.

I can get the map to open - but it's in the same ArcMap window (see code below).
        Dim mApp As ESRI.ArcGIS.Framework.IApplication
        Dim mDoc As ESRI.ArcGIS.Framework.IDocument
        mDoc = My.ArcMap.Application.Document
        mApp = mDoc.Parent
        mApp.Visible = True
        mApp.NewDocument(False, <file>)


How do I get the map to open in a new ArcMap window? I'm using ArcMap 10 and Visual Basic Express .NET 2008 SP1.
Cheers,
Olwyn
0 Kudos
2 Replies
BerendVeldkamp
Occasional Contributor II
I'm not sure, but does IAppRot.Add do what you want? Otherwise you could probably just start a new arcmap.exe process by calling Proces.Start("c:\path\to\arcmap.exe") and then get a reference to the new instance using IAppRot. Or save a new mxd and open that: Proces.Start("c:\path\to\mymxd.mxd")
0 Kudos
OlwynBruce
New Contributor III
Process.Start("path\to\mxd") totally worked! Thank you very much!!!
0 Kudos