The Outlook Standard Menu mess up

Add-in Express™ Support Service
That's what is more important than anything else

The Outlook Standard Menu mess up
Access the outlook build-in buttons 
richard lin




Posts: 25
Joined: 2008-09-25
I have found that Outlook will cache the last state of its command bars and menu in its explorer.

I have a function to disable some of the outlook standard commandbars under certain context. The program can disable the standard menu bars. But once the add-in is unregistered, and restart the outlook, the outlook will keep the last states for those standard buttons. The net effect is that some of the menu or command bar might be disabled unless I remove the outlook folder under "C:\Documents and Settings\[logonid]\Application Data\Microsoft\Outlook".

Is there anyway to avoid this problem? My code is attached as below:

private void disableExplorerNonKDMUICompoments(Outlook.Explorer explorer)
{
CommandBar standardBar = explorer.CommandBars["Standard"];
if (standardBar==null)
throw new ApplicationException("Unable to get the standardbar object ");

for (int i=1;i<standardBar.Controls.Count;i++)
{
if (standardBar.Controls[i].Id==1874 )
{
// disable button new
standardBar.Controls[i].Enabled=false;
}
}
}
Posted 07 Oct, 2008 17:29:58 Top
Eugene Astafiev


Guest


Hi Richard,

When do you run this sub?
Did you try to do the opposite action (enable buttons) ?

Posted 08 Oct, 2008 06:30:20 Top