ArcGIS Desktop のコマンド名・UID の取得

Sub getCommandsUID()
    Dim pApplication As IApplication
    Set pApplication = Application
    
    Dim pDocument As IDocument
    Set pDocument = ThisDocument
    
    Dim pCommandBars As ICommandBars
    Set pCommandBars = pDocument.CommandBars
    
    Dim pCommandItem As ICommandItem
    Set pCommandItem = pApplication.CurrentTool             'カレント ツールの取得
'    Set pCommandItem = pCommandBars.Find("PanZoom_ZoomIn") 'コマンドの名称から取得
    
    Dim pCommand As ICommand
    Set pCommand = pCommandItem.Command
    
    Debug.Print "'" & pCommand.Caption, pCommandItem.Name, pCommandItem.ID 'GUID (CLSID / ProgID)

End Sub