Findcontrol for submenu item?

  • Thread starter Thread starter Doug Glancy
  • Start date Start date
D

Doug Glancy

Hello,

Is there an equivalent to FindControl for a submenu item? E.g., in the
following code, I'd like the last line to be something like
Set cbarbutton = cbarcontrol.FindControl(ID:=542):

Sub test()
Dim cbar As CommandBar
Dim cbarcontrol As CommandBarControl
Dim cbarbutton As CommandBarButton

Set cbar = CommandBars("Format")
Set cbarcontrol = cbar.FindControl(ID:=30025)
Set cbarbutton = cbarcontrol.Controls("Width...")
End Sub

Thanks,

Doug Glancy
 
Doug,

The Recursive argument specifies that the search extend to the subbars.

Set cbarcontrol = cbar.FindControl(ID:=542, Recursive:=True)
 
Thanks John.

John Green said:
Doug,

The Recursive argument specifies that the search extend to the subbars.

Set cbarcontrol = cbar.FindControl(ID:=542, Recursive:=True)
 
Back
Top