Visible Property

Microsoft Outlook Visual Basic

Returns or sets a Boolean indicating the visible state of the specified object. True to display the object; False to hide the object. Read/write.

expression.Visible

expression    Required. An expression that returns one of the items in the Applies To list.

Remarks

You can also use the ShowPane method or the IsPaneVisible method of an Explorer object to set or retrieve this value.

Example

This Microsoft Visual Basic/Visual Basic for Applications (VBA) example toggles the visible state of the Shortcuts pane.

Sub ShowHideShortcutsBar()
	Dim myOlApp As New Outlook.Application
	Dim myOlBar As Outlook.OutlookBarPane
	Set myOlBar = myOlApp.ActiveExplorer.Panes.Item("OutlookBar")
	myOlBar.Visible = Not myOlBar.Visible
End Sub
		

If you use Microsoft Visual Basic Scripting Edition (VBScript) in a Microsoft Outlook form, you do not create the Application object. This example shows how to perform the same task using VBScript code.

Sub CommandButton1_Click()
 Set myOlBar = Application.ActiveExplorer.Panes.Item("OutlookBar")
 myOlBar.Visible = Not myOlBar.Visible
End Sub