ShowPane Method 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)