# [GIS] ArcMap commands .NET code equivalent

arcmaparcobjectsvb.net

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

Application.Document.CommandBars.Find(ArcID.Query_ClearSelection).Execute()


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.SubType = 3
pCmdItem = m_App.Document.CommandBars.Find(pUID)
pCmdItem.Execute()


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