Hi
I am using your code that is used to add an explorer to the outlook. In
addition to adding explorer bar I have also added a menu bar item in my
plugin
I am using the following code to add menu to the outlook (This is in
createMenu function)
CommandBar oCommandBar = IOMCalOutlookExplorer.CommandBars["Menu Bar"];
MSO.CommandBarPopup popup = (MSO.CommandBarPopup)oCommandBar .Controls.Add
(MSO.MsoControlType.msoControlPopup,myMissing,myMissing,myMissing,1);
popup.Caption = "IO&MCal";
popup.Visible = true;
MSO.CommandBar menuCmdBarSync = popup.CommandBar;
MenuSynchronizeButton = (MSO.CommandBarButton) menuCmdBarSync.Controls.Add
(MSO.MsoControlType.msoControlButton,myMissing,myMissing,1,1);
MenuSynchronizeButton.Caption = "&Synchronize";
MenuSynchronizeButton.Click +=new
MSO._CommandBarButtonEvents_ClickEventHandler(MenuSynchronizeButton_Click);
In Onclose function I am using the following code to free the objects
MenuSynchronizeButton.Click -=new
MSO._CommandBarButtonEvents_ClickEventHandler(MenuSynchronizeButton_Click);
if(MenuSynchronizeButton != null)
{
Marshal.ReleaseComObject(MenuSynchronizeButton);
}
if ( IOMCalOutlookCommandBar != null)
{
IOMCalOutlookCommandBar.Delete ();
Marshal.ReleaseComObject (IOMCalOutlookCommandBar);
}
if(IOMCalOutlookMenuCommandBar != null)
{
IOMCalOutlookMenuCommandBar.Delete ();
Marshal.ReleaseComObject (IOMCalOutlookMenuCommandBar);
}
if (IOMCalOutlookExplorer != null)
{
Marshal.ReleaseComObject (IOMCalOutlookExplorer);
}
This is working fine in my outlook (outlook 2003)
But in Outlook2002 objects are not releasing properly. A new menubar is
added each time I open the outlook. And also after uninstalling plugin from
the system it is not removed from the outlook.
Regards
Saurabh
Ken Slovak - [MVP - Outlook] - 25 Apr 2005 13:55 GMT
When you add the new menu bar make it temporary. Set the Temporary property
= True.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Hi
>
[quoted text clipped - 52 lines]
> Regards
> Saurabh
Saurabh Aggarwal - 26 Apr 2005 12:13 GMT
This is already true.
Could you please some example in c# which can add a menu item to the
menubar of the outlook and it gets disposed when we close it.
Regards
Saurabh
Ken Slovak - [MVP - Outlook] - 26 Apr 2005 14:33 GMT
I don't do C# so I can't supply you with any examples.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> This is already true.
> Could you please some example in c# which can add a menu item to the
> menubar of the outlook and it gets disposed when we close it.
>
> Regards
> Saurabh