Problem creating multileveled commandbars

  • Thread starter Thread starter Frode Lillerud
  • Start date Start date
F

Frode Lillerud

Hey,

I'm trying to add some options to the "Menu Bar" - you know the one with
File, Edit, View...etc.

File Edit View Tools MyOption
Option1
Option2

I'm able to create a option, MyOption, but I would also like to have some
options under it.
I have also tried to add a option under the Tools menu, and that also works
fine. But somehow I seem unable to add options under MyOption.
I get the errormessage : The Parameter is incorrect.

Here is a snippet of the code:

MenuBarItem = (CommandBarButton) oMainMenuBar.Controls.Add
(Office.Core.MsoControlType.msoControlButton, missing , missing , missing ,
missing);
MenuBarItem.Caption = Caption;
MenuBarItem.Style = MsoButtonStyle.msoButtonCaption;
MenuBarItem.Tag = Caption;

Is it correct to add a .msoControlButton? Or should I use another type?

Thanks
Frode
 
Back
Top