ShowPane Method

Microsoft Outlook Visual Basic

Show All

ShowPane Method

       

Displays or hides a specific pane in the explorer.

Note   You can also use the Visible property of the OutlookBarPane object to display or hide the Outlook Bar.

expression.ShowPane(Pane, Visible)

expression   Required. An expression that returns an Explorer object.

Pane   Required OlPane.

OlPane can be one of these OlPane constants.
olFolderList
olOutlookBar
olPreview

Visible   Required. True to make the pane visible, False to hide the pane.

Example

This Microsoft Visual Basic/Visual Basic for Applications example uses the ShowPane and IsPaneVisible methods to hide the preview pane if it is visible, or to display it if it is hidden.

Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Set myOlExp = myOlApp.ActiveExplorer
myOlExp.ShowPane olPreview, _
    Not myOlExp.IsPaneVisible(olPreview)

If you use VBScript, you do not create the Application object. This example shows how to perform the same task using VBScript.

Set myOlExp = Application.ActiveExplorer
myOlExp.ShowPane 3, Not myOlExp.IsPaneVisible(3)