Condividi tramite


IsPaneVisible Method

Returns a Boolean indicating whether a specific explorer pane is visible. Returns True if the specified pane is displayed in the explorer.

Note  You can also use the Visible property of the OutlookBarPane object to determine whether the Shortcuts pane is visible.

object**.IsPaneVisible(Pane)**

object Required. An expression that returns an Explorer object.

Pane    Required

OlPane

OlPane can be one of these OlPane constants.
olFolderList (2)
olOutlookBar (1)
olPreview (3)
olNavigationPane (4)

Example

This Microsoft Visual Basic/Visual Basic for Applications (VBA) sample uses the IsPaneVisible method to determine whether the preview pane is visible and uses the ShowPane method to display it if it is not visible. Use the olNavigationPane constant to hide or display the Navigation Pane.

Sub HidePreviewPane()
    Dim myOlApp As New Outlook.Application
    Dim myOlExp As Outlook.Explorer
    Set myOlExp = myOlApp.ActiveExplorer
    If myOlExp.IsPaneVisible(olPreview) = False Then
        myOlExp.ShowPane olPreview, True
    End If
    Set myOlApp = Nothing
    Set myOlExp = Nothing
End Sub

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

Set myOlExp = Application.ActiveExplorer
If myOlExp.IsPaneVisible(3) = False Then
    myOlExp.ShowPane 3,True
   Set myOlExp = Nothing
End If

Applies to | Explorer Object

See Also | ShowPane Method