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
Printable View
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
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.
Here's some code that will add your menue before the Help menu.
VB Code:
Sub sample() Dim lPosition As Long Dim ctlControl As CommandBarControl 'Determine the Position of the Help MENU For Each ctlControl In CommandBars.ActiveMenuBar.Controls If ctlControl.Caption = "&Help" Then lPosition = ctlControl.Index Exit For End If Next 'Add Your Menu Set ctlControl = ActiveMenuBar.Controls.Add(msoControlPopup, , , lPosition, True) End Sub
cheers very much
:-)