Results 1 to 12 of 12

Thread: Adding icons to custom commandbar menus

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Oops, sorry, it's going to need the corresponding Functions:

    Public Function FN_booMenuExists(cmb As CommandBar, strMenuTitle As String) As Boolean
    Dim cbc As CommandBarControl
    FN_booMenuExists = False
    For Each cbc In cmb.Controls
        If cbc.Caption = strMenuTitle Then FN_booMenuExists = True
    Next cbc
    End Function
    
    Public Function FN_booFlyOutExists(cbp As CommandBarPopup, strFlyOutTitle As String) As Boolean
    Dim cbc As CommandBarControl
    FN_booFlyOutExists = False
    For Each cbc In cbp.Controls
        If cbc.Caption = strFlyOutTitle And cbc.Type = msoControlPopup Then FN_booFlyOutExists = True
    Next cbc
    End Function
    
    Public Function FN_booItemExists(cbp As CommandBarPopup, strItemCaption As String) As Boolean
    Dim cbc As CommandBarControl
    FN_booItemExists = False
    For Each cbc In cbp.Controls
        If cbc.Caption = strItemCaption Then FN_booItemExists = True
    Next cbc
    End Function
    
    Public Function FN_cbpSetFlyOut(cbpRoot As CommandBarPopup, strFlyOutTitle As String) As CommandBarPopup
    Dim cbc As CommandBarControl
    Set FN_cbpSetFlyOut = Nothing
    For Each cbc In cbpRoot.Controls
        If cbc.Caption = strFlyOutTitle And cbc.Type = msoControlPopup Then Set FN_cbpSetFlyOut = cbc
    Next cbc
    End Function
    Last edited by Aussiebear; 04-26-2023 at 07:12 PM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •