Office.MsoControlType.msoControlSplitButtonPopup

H

Hotwheels

Can I create a Office.MsoControlType.msoControlSplitButtonPopup using VS 2005
C# and VSTO SE 2005?

I cannot seem to find any thing on it. I want to have a button like the
Send and Receive button.

Is it true I cannot create a button of this type?

I put this code together but I have to use two controls a button and a popup
to get the same results.


CustomButton =
(Office.CommandBarButton)newToolbar.Controls.Add(Office.MsoControlType.msoControlButton, Type.Missing, Type.Missing, Type.Missing, true);
CustomButton.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonIconAndCaption;
CustomButton.Caption = "Send to EquityWorks";
CustomButton.Tag = "Send Emails to EquityWorks";
CustomButton.Enabled = true;
CustomButton.Picture = getImage();
CustomButton.Mask = getMask();
CustomButton.Click += new
Office._CommandBarButtonEvents_ClickEventHandler(CustomButtonClick);

Office.CommandBarPopup barPopup =
newToolbar.Controls.Add(Office.MsoControlType.msoControlPopup, missing,
missing, missing, true) as Office.CommandBarPopup;
barPopup.Caption = " ";
Office.CommandBarButton btn =
barPopup.Controls.Add(Office.MsoControlType.msoControlButton, missing,
missing, missing, true) as Office.CommandBarButton;
btn.Caption = "hot";
btn.Click += new
Office._CommandBarButtonEvents_ClickEventHandler(btnClick);
Office.CommandBarButton btn2 =
barPopup.Controls.Add(Office.MsoControlType.msoControlButton, missing,
missing, missing, true) as Office.CommandBarButton;
btn2.Caption = "warm";
btn2.Click += new
Office._CommandBarButtonEvents_ClickEventHandler(btn2Click);


Thanks

Mike
 
S

SvenC

Hi Hotwheels,
Can I create a Office.MsoControlType.msoControlSplitButtonPopup using VS 2005
C# and VSTO SE 2005?

I cannot seem to find any thing on it. I want to have a button like the
Send and Receive button.

Is it true I cannot create a button of this type?

Yes, the command bar API does not expose all functionality of the command
bars. I guess this will not change anymore as the Ribbon replaced menus and
command bars.

The Ribbon in contrast seems to expose every functionality by API. If Office
2007 is an option you might consider to have a closer look at how you can
use the Ribbon for your Addin.

I did only native Addin development with C++ and COM, so I am not sure
if VS2005 and its VSTO do expose the Ribbon stuff already.
 

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