|
-
Jan 27th, 2006, 04:29 AM
#1
Thread Starter
Lively Member
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
-
Jan 27th, 2006, 09:34 AM
#2
Lively Member
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.
-
Jan 27th, 2006, 12:36 PM
#3
Re: placing items in menu bar
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
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Jan 30th, 2006, 12:02 PM
#4
Thread Starter
Lively Member
Re: placing items in menu bar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|