View Single Post
  #4  
Old May 12th 09, 02:58 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Multiple Toolbars being added/Multiple Buttons being added to

The CommandBars.Add() method has a temporary argument, set it to True if you
create a new CommandBar object. The CommandBarControls.Add() method also has
that argument available when you add a new control to a CommandBar
(menu/toolbar). Also set that True.

That's generally enough, but if for some reason Outlook doesn't correctly
close or crashes a belt plus suspenders approach is to handle the
Inspector.Close() event on any Inspector you are adding UI to, and the
Explorer.Close() event on any Explorer you add UI to. In those event
handlers you get your references to the controls and commandbars you added
and call their Delete() method to delete them.

There's lots of sample code in various languages at www.outlookcode.com that
shows handling those Close() events and how to handle adding and removing
UI. Take a look there for samples in your language.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Matt" wrote in message
...
I'm fairly new to Outlook programming, how do I do that?


Ads