CAB Outlook bar

Chris Holmes, an active member of the CAB messageboards, blogged about
how to create an outlook bar and the corresponding CAB classes. Here you have a snapshot:

outlookbar

You can register the Outlook Bar...


OutlookBar outlookBar = RootWorkItem.Items.AddNew<OutlookBar>();

RootWorkItem.UIExtensionSites.RegisterSite("OutlookBar", outlookBar);

Then you can add/remove buttons to the bar...


Button button = new Button();

button.Text = "Payroll";

button.Image = MyProject.Modules.Payroll.Properties.Resources.payroll;

RootWorkItem.UIExtensionSites["OutlookBar"].Add

(button);

RootWorkItem.Commands["LoadPayrollWorkItem"].AddInvoker(button, "Click");

...and smartparts as well.


SomeSmartPart smartPart = this.Items.AddNew("OutlookBarSmartPart");

RootWorkItem.Workspaces["OutlookBarDeckWorkspace"].Show(smartPart);

Finally, another way to design this control is by creating a
custom IWorkspace that accepts a smartpart and a smartpartinfo that
holds the button information so you can do something like this:

OutlookBarSmartPartInfo info = new OutlookBarSmartPartInfo();

info.Text = "Payroll";

info.Image = MyProject.Modules.Payroll.Properties.Resources.payroll;

RootWorkItem.Workspaces["OutlookBar"].Show(smartPart, info);

Published: April 23 2006

blog comments powered by Disqus