Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / November 2005

Tip: Looking for answers? Try searching our database.

Addin Outlook + Command bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raphael - 23 Nov 2005 15:51 GMT
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;
Helmut Obertanner - 29 Nov 2005 22:27 GMT
I don't know if it helps, but maybe you will find my X4UTools sample
here usefull.
Deals with Explorers and Inspectors and Toolbars and Buttons.
It's a VSTO Sample, but the code for the Buttons is just the same.

http://www.x4u.de/Outlook/Samples/tabid/77/Default.aspx

with regards / mit freundlichen Grüßen

Helmut Obertanner
X4U electronix
web: www.x4u.de

... X4U rocks !

> -----Original Message-----
> From: Raphael [mailto:r.michel@analytel.com]
[quoted text clipped - 87 lines]
>
> oCommandBars = null;
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.