Addin Outlook + Command bar

R

Raphael

Hello,
I would like to create a custom button (or custom command bar) in contact's
form.

I already created custom button on "standard" command ...
plzzzzzzz help :)


CommandBars oCommandBars;

CommandBar oStandardBar;

try

{

oCommandBars =
(CommandBars)applicationObject.GetType().InvokeMember("CommandBars",
BindingFlags.GetProperty , null, applicationObject ,null);

}

catch

{

object oActiveExplorer;

oActiveExplorer=
applicationObject.GetType().InvokeMember("ActiveExplorer",BindingFlags.GetProperty,null,applicationObject,null);

oCommandBars=
(CommandBars)oActiveExplorer.GetType().InvokeMember("CommandBars",BindingFlags.GetProperty,null,oActiveExplorer,null);

}

oStandardBar = oCommandBars["Standard"];

try

{

MyButtontest= (CommandBarButton)oStandardBar.Controls["MyButtontest"];

}

catch

{

object omissing = System.Reflection.Missing.Value ;

MyButtontest = (CommandBarButton) oStandardBar.Controls.Add(1, omissing ,
omissing , omissing , omissing);

MyButtontest.Caption = "test";

MyButtontest.Style = MsoButtonStyle.msoButtonIconAndCaption;

MyButtontest.Style = MsoButtonStyle.msoButtonIconAndWrapCaptionBelow;


MyButtontest.Tag = "Synchronisation";

MyButtontest.OnAction = "!<MyButtontest.Connect>";

MyButtontest.FaceId = 3199;

MyButtontest.Visible = true;

MyButtontest.Click += new
Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(this.MyButtontest_Click);

}


object oName =
applicationObject.GetType().InvokeMember("Name",BindingFlags.GetProperty,null,applicationObject,null);

oStandardBar = null;

oCommandBars = null;
 

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