How to call the Add Data button in ArcMap in AddIn

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

Accepted Solutions
Highlighted
MVP Honored 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

Reply
0 Kudos
1 Reply
Highlighted
MVP Honored 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

Reply
0 Kudos