The sequence "Alt" + clicking creates a very annoying and persistent "research" toolbar in Office 2010.
How can I remove this via VBA?
You can also do this in Outlook via VBA. Office 2010 no longer lets you remove via most of these solutions.
Word, PowerPoint, and Excel allow you to use this easy. Simply using:
Application.CommandBars("Research").Enabled = False
will disable the commandbar from those applications.
Outlook requires more hassle as it uses both Explorers and Inspectors, which in different contexts both have this commandbar enabled. The solution is therefore two part.
Part one is setting up WithEvents
to handle creation of each new Inspector. Generally these are whenever you OPEN a message/event/etc, and they are created/destroyed each time. So even if you hit every current Inspector, your new ones will not have the commandbar disabled.
Put the following into ThisOutlookSession in your VBA editor (Alt+F11). Each new inspector (and explorer, too, though I've yet to have an explorer created) will have its command bar disabled.
Public WithEvents colInspectors As Outlook.Inspectors
Public WithEvents objInspector As Outlook.Inspector
Public WithEvents colExplorers As Outlook.Explorers
Public WithEvents objExplorer As Outlook.Explorer
Public Sub Application_Startup()
Init_colExplorersEvent
Init_colInspectorsEvent
End Sub
Private Sub Init_colExplorersEvent()
Set colExplorers = Outlook.Explorers
End Sub
Private Sub Init_colInspectorsEvent()
'Initialize the inspectors events handler
Set colInspectors = Outlook.Inspectors
End Sub
Private Sub colInspectors_NewInspector(ByVal NewInspector As Inspector)
Debug.Print "new inspector"
NewInspector.commandbars("Research").Enabled = False
'This is the code that creates a new inspector with events activated
Set objInspector = NewInspector
End Sub
Private Sub colExplorers_NewExplorer(ByVal NewExplorer As Explorer)
'I don't believe this is required for explorers as I do not think Outlook
'ever creates additional explorers... but who knows
Debug.Print "new explorer"
NewExplorer.commandbars("Research").Enabled = False
'This is the code that creates a new inspector with events activated
Set objExplorer = NewExplorer
End Sub
However this only will get the menu gone from some of the views in Outlook. You will still need to run the following macro to remove it from all explorers. As best I can tell this is persistent when you close/reopen Outlook:
Private Sub removeOutlookResearchBar()
'remove from main Outlook explorer
Dim mExp As Explorer
For Each mExp In Outlook.Explorers
mExp.commandbars("Research").Enabled = False
Next mExp
End Sub