standard toolbar in outlook 2007

J

Julian

I have created a VSTO addin in c# that works fine with outlook 2003 In
it I have added a button to each inspector on the standard command
bar.

When I apply the code to outlook 2007 the button does appear, but it
is displayed in a new ribbon rather than in the main standard
ribbon(which is where I would like it to be)

The code to add the button is displayed below.

Any ideas/help would be greatly appreciated.

Many thanks in advance


try
{ logicanBar =
(Office.CommandBar)Inspector.CommandBars["Standard"]; }
catch (System.Exception)
{ logicanBar = Inspector.CommandBars.Add("Standard",
missing, missing, true); }
logicanBar.Position =
Microsoft.Office.Core.MsoBarPosition.msoBarTop;

Outlook.MailItem mailItem =
(Outlook.MailItem)Inspector.CurrentItem;
logicanBar.Visible = true;

sendAndSaveButton =
(Office.CommandBarButton)logicanBar.FindControl(Office.MsoControlType.msoControlButton,
missing, "SendAndSave", true, true);
if (sendAndSaveButton == null)
{
sendAndSaveButton =
(Office.CommandBarButton)logicanBar.Controls.Add(Office.MsoControlType.msoControlButton,
missing, missing, missing, true);
}

sendAndSaveButton.BeginGroup = true;
sendAndSaveButton.Caption = "Send And Save";
sendAndSaveButton.Tag = "SendAndSave";
sendAndSaveButton.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption;
 
K

Ken Slovak - [MVP - Outlook]

If you add a CommandBarButton to an Outlook 2007 Inspector it will always be
placed in the Add-Ins tab in a group for your addin. You need to support the
ribbon, which in VSTO usually means a separate addin for Outlook 2007. You
can try the workarounds listed on XL-Dennis's blog for an
IRibbonExtensibility tlb or you can go with separate addins. Office 2003 has
no support for the ribbon and that's what you're writing against using an
Office 2003 dev machine.
 

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