Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the .NET code equivalent for this general ArcMap command syntax:


I have been using this one below as a work around, however it is much more code than what I would like to use.

Dim pUID As New UID
Dim pCmdItem As ICommandItem
'Use the GUID of the Save command
pUID.Value = "{AB073B49-DE5E-11D1-AA80-00C04FA37860}"
'or you can use the ProgID
'pUID.Value = "esriArcMapUI.MxFileMenuItem"
pUID.SubType = 3
pCmdItem = m_App.Document.CommandBars.Find(pUID)


share|improve this question
up vote 1 down vote accepted

That's about the best way that you can do it (that I know of).

You might be able to tack on Execute at the end of your pCmdItem assignment, i.e.

pCmdItem = m_App.Document.CommandBars.Find(pUID).Execute()

but that's the only "optimization" I can think of. A lot of overhead is taken care of when you're using ArcMap rather than ArcEngine.

share|improve this answer
So, there is not a newer variation to the "ArcID" built-in module, becuase this only existed within ArcMap VBA? – artwork21 Jun 8 '11 at 18:20
@artwork21 Not to my knowledge. GUIDs and ProgIDs are all I've ever used to access tools on the toolbar. – Michael Todd Jun 8 '11 at 19:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.