How to call the Add Data button in ArcMap in AddIn

504
1
Jump to solution
11-01-2012 12:29 PM
YimanSong
New Contributor III
I know in Engine you can use the AddDataCommand. Can you somehow do the same in ArcMap AddIn?
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
Here's one way to do this:

Dim pCmdItem As ESRI.ArcGIS.Framework.ICommandItem Dim pUID As New ESRI.ArcGIS.esriSystem.UID pUID.Value = "esriArcMapUI.AddDataCommand" pCmdItem = My.ArcMap.Application.Document.CommandBars.Find(pUID) pCmdItem.Execute()


Or you can use the IGXDialog if you'd like more control over the datasets you'd like to add. Here's one example of how to use it

View solution in original post

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor
Here's one way to do this:

Dim pCmdItem As ESRI.ArcGIS.Framework.ICommandItem Dim pUID As New ESRI.ArcGIS.esriSystem.UID pUID.Value = "esriArcMapUI.AddDataCommand" pCmdItem = My.ArcMap.Application.Document.CommandBars.Find(pUID) pCmdItem.Execute()


Or you can use the IGXDialog if you'd like more control over the datasets you'd like to add. Here's one example of how to use it
0 Kudos