submenu deletion

  • Thread starter Thread starter .:alex:.
  • Start date Start date
A

.:alex:.

Hello,

In OnConnection Event I create a menu of this type:

Private WithEvents oMenuItem As Office.CommandBarButton

But I have a problem, I cannot delete the menu when I close Outlook, so
every time when I open Outlook, a new submenu with the same name is added.
I tryed to remove with this command: oMenuItem.Delete

in OnBeginShutdown and OnDisconnection Events, but nothing, I got some
errors.

Can somebody tell me the good way to delete the submenu?

Thank in advance,

Alex
 
Hi alex.

A better place would be in Explorer.Deactivate event or Explorer Close
Event.
In OnDisconnection the Explorers sometimes arn't accessible.

You could also create your Menus as temporary Menus.

Hope that helps.
Greets, Helmut Obertanner.
 
In On_Disconnection the Explorers are never available since that event will
only fire after all your Outlook objects have been released if the user if
closing Outlook. The only time Explorers are available in On_Disconnection
is if the user disconnects the addin from the Tools, Options dialog.
 
Back
Top