既存コマンドの CLSID を取得する方法

'■ThisDocument
-----------------------------------
Dim m_pCustomizationFilterr As ICustomizationFilter

Private Function MxDocument_BeforeCloseDocument() As Boolean
        Application.UnlockCustomization "password"
End Function
 
Private Function MxDocument_NewDocument() As Boolean
    Set m_pCustomizationFilterr = New clsMyCustFilter
    Application.LockCustomization "password", m_pCustomizationFilterr
 
End Function
 
Private Function MxDocument_OpenDocument() As Boolean
    Set m_pCustomizationFilterr = New clsMyCustFilter
    Application.LockCustomization "password", m_pCustomizationFilterr
End Function


'■clsMyCustFilter.cls
-----------------------------------
Implements ICustomizationFilter

Private Function ICustomizationFilter_OnCustomizationEvent(ByVal custEventType As esriCustomizationEvent, ByVal eventCtx As Variant) As Boolean
Dim lSubType As Long

    If custEventType = esriCEInvokeCommand Then
        Dim pCommandItem As ICommandItem
        Set pCommandItem = eventCtx

        Debug.Print "Name: ", pCommandItem.Name
        Debug.Print "Category: ", pCommandItem.Category
        Debug.Print "Caption: ", pCommandItem.Caption
        Debug.Print "CLSID: ", pCommandItem.ID.Value
        Debug.Print
    End If

End Function