Hide Commandbar at Startup

Control by code which of the commandbars should be visible at startup.

Last modified: 2009/08/15 | Accessed: 59.094  | #74
◀ Previous sample Next sample ▶
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.

Many Addins install a new toolbar in Outlook and always display it - even if you'd rather keep it invisible.

This example demonstrates how to access a toolbar at startup via its name und make it invisible. Copy the code to the module "ThisOutlookSession", and set the variable 'Name' onto the name of the desired toolbar.

(If you don't know the toolbar's name: Right click on any toolbar and you'll get a list of all of the available names.)

tip  How to add macros to Outlook
Private Sub Application_Startup()
  On Error Resume Next
  Dim Bar As Office.CommandBar
  Dim Name As String

  Name = "Standard"

  Set Bar = Application.ActiveExplorer.CommandBars(Name)
  If Not Bar Is Nothing Then Bar.Visible = False
End Sub
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
email  Send a message