HideFormPage Method

Hides a form page in the inspector.

expression**.HideFormPage(PageName)**

*expression   * Required. An expression that returns an Inspector object.

PageName Required String. The display name of the page to be hidden.

Example

This Visual Basic for Applications (VBA) example uses HideFormPage to hide the "General" page of a newly-created ContactItem and displays the item.

Sub HidePage()
    Dim myOlApp As Outlook.Application
    Dim MyItem As Outlook.ContactItem
    Dim myPages As Outlook.Pages
    Dim myinspector As Outlook.Inspector
    Set myOlApp = CreateObject("Outlook.Application")
    Set MyItem = myOlApp.CreateItem(olContactItem)
    Set myPages = MyItem.GetInspector.ModifiedFormPages
    myPages.Add "General"
    Set myinspector = myOlApp.ActiveInspector
    myinspector.HideFormPage "General"
    MyItem.Display
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 myItem = Application.CreateItem(2)
Set myInspector = myItem.GetInspector
Set myPages = myInspector.ModifiedFormPages
myPages.Add "General"
myInspector.HideFormPage"General"
myItem.Display

Applies to | Inspector Object