Failed to delete custom menu

  • Thread starter Ulrik Gustafsson
  • Start date
U

Ulrik Gustafsson

I have a problem with my Outlook com-addin.
My com-addin creates a custom toolbar and a custom menu on the Menu Bar.

On the AddIn_Disconnect event when I close Outlook, the toolbar is deleted
because I have set the temporary
flag to True but the menu is not deleted. I know that there is no
ActiveExplorer when the add-in is disconnects from Outlook when
Outlook closes but how to do then?

I also know you can trap Explorer_Close event like in Randy Byrnes Items CB
example.

Maybe is the solution to delete the custom menu in the Explorer_Close event
But, when there is no explorers open, should not this code fail because
there is no active explorer?
How to solve this?

Set objControl = g_objOutlook.ActiveExplorer.CommandBars.FindControl(, ,
Tag:="MyMenu")
objControl.Delete

Thanks in advance

Ulrik
 
V

Venketash \(Pat\) Ramadass

I use something like...

objOutlookCommandBar.Controls.Add(Type:=msoControlPopup, Before:=intBefore,
Temporary:=True)

To add my addin menu to the objOutlookCommandBar
(objExplorerORInspector.CommandBars.ActiveMenuBar) object. Seems to work the
same way any of my temporary toolbar items do.

-Pat
(e-mail address removed)
 

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