submenu deletion

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
 
H

Helmut Obertanner

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.
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top