Hallo Dom,
ich hatte mal was gesehen um Menüs quasi „auszulesen“, insbesondere um die IDs zu finden. Da kann man dann auch die Eigenschaft onAction auslesen. Hoffe die ist auch bei „dir“ gefüllt.
Sub ListXLPopups()
Dim cbCtl As Variant
Dim cbBar As CommandBar
On Error Resume Next
Application.ScreenUpdating = False
Cells(1, 1).Value = "CommandBar"
Cells(1, 2).Value = "Control"
Cells(1, 3).Value = "FaceID"
Cells(1, 4).Value = "ID"
i = 2
For Each cbBar In CommandBars
Application.StatusBar = "Processing Bar " & cbBar.name
Cells(i, 1).Value = cbBar.name
Cells(i, 2).Value = cbBar.NameLocal
i = i + 1
For Each cbCtl In cbBar.Controls
Cells(i, 2).Value = cbCtl.Caption
Cells(i, 3).Value = cbCtl.ID
Select Case cbCtl.Type
Case 10:
Cells(i, 4).Value = "Type:" & cbCtl.Type
For k = 1 To cbCtl.Controls.Count
i = i + 1
Cells(i, 3).Value = cbCtl.Controls(k).Caption
Cells(i, 4).Value = cbCtl.Controls(k).ID
Cells(i, 5).Value = "Type:" & cbCtl.Controls(k).Type
If (cbCtl.Controls(k).OnAction "") Then
Cells(i, 6).Value = "onAction:" & cbCtl.Controls(k).OnAction
End If
Select Case cbCtl.Controls(k).Type
Case 1, 4, 6, 7, 9, 10, 12, 13, 14:
i = i + 0
Case Else
cbCtl.cbCtl.Controls(k).CopyFace
ActiveSheet.Paste Cells(i, 4)
If (cbCtl.FaceId cbCtl.ID) Then Cells(i, 5).Value = cbCtl.Controls(k).FaceId
For m = 1 To cbCtl.Controls(k).Controls.Count
i = i + 1
Cells(i, 4).Value = cbCtl.Controls(k).Controls(m).Caption
Cells(i, 5).Value = cbCtl.Controls(k).Controls(m).ID
Cells(i, 6).Value = "Type:" & cbCtl.Controls(k).TControls(m).Type
If (cbCtl.Controls(k).OnAction "") Then
Cells(i, 6).Value = "onAction:" & cbCtl.Controls(k).OnAction
End If
Select Case cbCtl.Controls(k).Controls(m).Type
Case 1, 4, 6, 7, 9, 10, 12, 13, 14:
Case Else
cbCtl.cbCtl.Controls(k).Controls(m).CopyFace
ActiveSheet.Paste Cells(i, 5)
If (cbCtl.FaceId cbCtl.ID) Then Cells(i, 5).Value = cbCtl.Controls(k).Controls(m).FaceId
End Select
Next
End Select
Next
Case 2, 3, 4, 6, 7, 9, 12, 13, 18, 21, 25:
Cells(i, 4).Value = "Type:" & cbCtl.Type
Case Else
cbCtl.CopyFace
ActiveSheet.Paste Cells(i, 4)
If (cbCtl.FaceId cbCtl.ID) Then Cells(i, 4).Value = cbCtl.FaceId
End Select
i = i + 1
Next
Next cbBar
Range("A:B").EntireColumn.AutoFit
Application.StatusBar = False
End Sub
Die Routine schreibt alle Menupunkte und symbole in eine Tabelle, ggfs. halt auch onAction.
mfg
Dirk.Pegasus