Adding commandbar with drop down arrow

  • Thread starter Thread starter Saurabh Aggarwal via OfficeKB.com
  • Start date Start date
S

Saurabh Aggarwal via OfficeKB.com

Hi

I found one of the article
http://www.outlookcode.com/codedetail.aspx?id=789
Here it is shown how can we add commandbar. It adds one commandbutton and
one combobox to the command bar.
Now I want to make some changes in it.
Just like in outlook on the top left we have "New" button with a drop down
arrow on its right. New button performs task of the first option of the
drop down. I want to add similar kind of plugin.

Any Clue

Regards

Saurabh
 
saurabh aggarwal 13-Apr-2005 04:00
Hi

I am using the following code to add my menu item to the main menu of
outlook.
The menu have two buttons named Synchronize, and Settings


CommandBar cmd = IOMCalOutlookExplorer.CommandBars["Menu Bar"];
MSO.CommandBarPopup popup = (MSO.CommandBarPopup)cmd.Controls.Add
(MSO.MsoControlType.msoControlPopup,myMissing,myMissing,myMissing,1);
popup.Caption = "DEMO";
popup.Visible = true;

MSO.CommandBar menuCmdBar = popup.CommandBar;
MenuSynchronizeButton = (MSO.CommandBarButton) menuCmdBarSync.Controls.Add
(MSO.MsoControlType.msoControlButton,myMissing,myMissing,1,1);
MenuSynchronizeButton.Caption = "Synchronize";
MenuSynchronizeButton.Click +=new
MSO._CommandBarButtonEvents_ClickEventHandler(MenuSynchronizeButton_Click);
MenuSettingsButton = (MSO.CommandBarButton) menuCmdBarSync.Controls.Add
(MSO.MsoControlType.msoControlButton,myMissing,myMissing,myMissing,1);
MenuSettingsButton.Caption = "Settings";
MenuSettingsButton.Click +=new
MSO._CommandBarButtonEvents_ClickEventHandler(MenuSettingsButton_Click);

Menu is working fine. When I click on Synchronize button, then
corresponding event handler
is cladded and when I hit on Settings button then corresponding
eventhandler is called.
Now I want to add shortcut keys to it.
Alt D - To open Demo menu
Ctrl (something) - Hit of synchronize button
Ctrl (something) - Hit of Settings Button

I tried with following line

popup.Caption = "&DEMO";
but this is not working

Any Clue

Regards
Saurabh
 
Please hurry up guys. My deadline is very close to me

Regards

Saurabh
 
Back
Top