N
Neetu
I have to create a add-in for outlook using Visual studio 2008 for outlook
2007.
Need to create a commandbarbutton on each inspector if item type is mail.
on NewInspector event , i wrote this code.
void Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector
Inspector)
{
if (Inspector != null)
{
if (Inspector.CurrentItem is
Microsoft.Office.Interop.Outlook.MailItem)
{
Office.CommandBarButton objCommandbar;
try
{
objCommandbar =
(Office.CommandBarButton)Inspector.CommandBars["Standard"].Controls[_strMycommandbuttonName];
}
catch (Exception ex)
{
objCommandbar =
(Office.CommandBarButton)Inspector.CommandBars["Standard"].Controls.Add(1,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, true);
objCommandbar.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption;
objCommandbar.Caption = _strMycommandbuttonName;
objCommandbar.Tag = _strMycommandbuttonName;
objCommandbar.Visible = true;
objCommandbar.Click += new
Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(objCommandbar_Click);
}
}
}
}
a new button has been created in my outlook however it is coming inside
another tab called "Addin" after "Message" tab.
However I want this new button in same "Message" tab.
how can achieve that?
Also I want to give a good picture to Button.
How can i add image to my custom button.
Thanks
Neetu
2007.
Need to create a commandbarbutton on each inspector if item type is mail.
on NewInspector event , i wrote this code.
void Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector
Inspector)
{
if (Inspector != null)
{
if (Inspector.CurrentItem is
Microsoft.Office.Interop.Outlook.MailItem)
{
Office.CommandBarButton objCommandbar;
try
{
objCommandbar =
(Office.CommandBarButton)Inspector.CommandBars["Standard"].Controls[_strMycommandbuttonName];
}
catch (Exception ex)
{
objCommandbar =
(Office.CommandBarButton)Inspector.CommandBars["Standard"].Controls.Add(1,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, true);
objCommandbar.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption;
objCommandbar.Caption = _strMycommandbuttonName;
objCommandbar.Tag = _strMycommandbuttonName;
objCommandbar.Visible = true;
objCommandbar.Click += new
Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(objCommandbar_Click);
}
}
}
}
a new button has been created in my outlook however it is coming inside
another tab called "Addin" after "Message" tab.
However I want this new button in same "Message" tab.
how can achieve that?
Also I want to give a good picture to Button.
How can i add image to my custom button.
Thanks
Neetu