Results 1 to 4 of 4

Thread: placing items in menu bar

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    80

    placing items in menu bar

    hi there

    i have an add which adds a control to the menu bar in outlook

    how can i place it so that it is placed second to last (before the help control)

    this must also be done dynamically, as other add in controls may be installed

    many thanks

    Jamie

  2. #2
    Lively Member
    Join Date
    Jun 2005
    Posts
    112

    Re: placing items in menu bar

    In the add method for a commandbar control, there is an optional argument "before".
    .Add(Type, Id, Parameter, Before, Temporary)
    Reference the index of the help button on your commandbar there and your button will show up where you want it to.

  3. #3
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: placing items in menu bar

    Here's some code that will add your menue before the Help menu.

    VB Code:
    1. Sub sample()
    2. Dim lPosition As Long
    3. Dim ctlControl As CommandBarControl
    4.  
    5.    
    6.     'Determine the Position of the Help MENU
    7.     For Each ctlControl In CommandBars.ActiveMenuBar.Controls
    8.        If ctlControl.Caption = "&Help" Then
    9.             lPosition = ctlControl.Index
    10.             Exit For
    11.        End If
    12.     Next
    13.  
    14.     'Add Your Menu
    15.     Set ctlControl = ActiveMenuBar.Controls.Add(msoControlPopup, , , lPosition, True)
    16.  
    17. End Sub
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    80

    Re: placing items in menu bar

    cheers very much

    :-)

Posting Permissions

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



Click Here to Expand Forum to Full Width