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;
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;