Problem creating multileveled commandbars

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top