This Microsoft Visual Basic/Visual Basic for Applications example toggles the visible state of the Outlook Bar.
Dim myOlApp As New Outlook.Application
Dim myOlBar As Outlook.OutlookBarPane
Set myOlBar = myOlApp.ActiveExplorer.Panes.Item("OutlookBar")
myOlBar.Visible = Not myOlBar.Visible
If you use VBScript, you do not create the Application object. This example shows how to perform the same task using VBScript.
Set myOlBar = Application.ActiveExplorer.Panes.Item("OutlookBar")
myOlBar.Visible = Not myOlBar.Visible