Command bar control

Menka

New member
Joined
Jan 22, 2005
Messages
1
Programming Experience
Beginner
i have a problem in vb.net with command bar.
my problem is when i try to add a menu at rumtime to my outlooh item, it gives parameter is incorrect.

the code is as follows it gives error on the last line,
Public objTestBar As Office.CommandBar

Dim objPopUp As Office.CommandBarPopup

objTestBar = objItem.GetInspector.CommandBars.Add("MyToolbar", Office.MsoBarPosition.msoBarTop, True, True) 'msoBarTop

objTestBar.Visible = True

objTestBar = objItem.GetInspector.CommandBars("Menu Bar")

objPopUp = objTestBar.Controls.Add(MsoControlType.msoControlPopup, 1, "", 1,
True)

objPopUp.Caption = "&File"

objPopUp.Visible =
True

objCommandBars("Menu Bar").Controls("&File").Controls("&Save").Copy(objPopUp.Controls.Parent)

 
Top Bottom