If you don't set position the control will be added at the end of the
toolbar no matter how many other addins add their controls to that toolbar.

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm

"nf" <Nazfaz@gmail.com> wrote in message
news:2a9ef0b9-cb35-4ef3-9438-6f7a8f05538c@y22g2000prd.googlegroups.com...
> Hi,
>
> I developed an outlook add-in using VS 2005. The add-in adds a new
> menu item (QB) in the Menu Bar by adding a CommanBarPopup to the Menu
> Bar.I get a count of all controls in the Menu Bar Command Bar and add
> the new menu at position = count + 1. Everything works fine. The
> problem occurs when there are multiple add-Ons installed. and those
> add-ins also add a new menu item in the menu bar at the end. In such
> case only one menu item is displayed. Either mine or the other add-
> ons. Both dont get shown at one time. Can anybody please help me.
> My code is as follow
> Dim objCmdBar As CommandBar =
> applicationObject.ActiveExplorer().CommandBars("Menu Bar")
> objCmdBar.Reset()
>
> Dim objCommandBarPopup As CommandBarPopup 'used for adding
> the 'QB' Popup menu to main menu bar in outlook
> Dim objMainCmdBarControl As CommandBarControl 'used for
> adding new controls to 'QB' PopUp Menu
>
>
> Dim position As Integer
>
> 'Add a new pop up menu 'QB' to Menu Bar
> Try
> objCommandBarPopup = CType(objCmdBar.Controls("QB"),
> CommandBarPopup)
> Catch ex As SystemException
>
>
>
> position = objCmdBar.Controls.Count + 1
>
>
>
> objCommandBarPopup =
> CType(objCmdBar.Controls.Add(MsoControlType.msoControlPopup,
> Missing.Value, Missing.Value, position, True), CommandBarPopup)
> objCommandBarPopup.Caption = "QB"
> End Try
>
> 'Adding the CommandBar buttons to the QB Menu
> With objCommandBarPopup
> .Visible = True
> .Tag = "QB"
> objMainCmdBarControl
> = .Controls.Add(MsoControlType.msoControlButton, Missing.Value,
> Missing.Value, Missing.Value, Missing.Value)
>
> Login = CType(objMainCmdBarControl, CommandBarButton)
> With Login
> .Caption = "Login"
> '.Tag = "Login"
> .Visible = True
> End With
> End with
>
10 JunMultiple Outlook Add-in problem.nf
12 Jun\ Re: Multiple Outlook Add-in problem.Ken Slovak - [MVP - O...
All times are in (US) Eastern Daylight Time (GMT -4:00)