This seems to walk its way back up the tree nicely, even if you append part way down an exsiting menu
Dim ctl As CommandBarControl
Dim ctlparent As CommandBarControl
Dim msg As String
Set ctl = Application.CommandBars.ActionControl
msg = ctl.Caption
Do
Set ctlparent = Nothing
On Error Resume Next
Set ctlparent = ctl.Parent.Parent
On Error GoTo 0
If Not ctlparent Is Nothing Then
Set ctl = ctlparent
msg = msg & vbNewLine & ctl.Caption
End If
Loop Until ctlparent Is Nothing
MsgBox msg