SetCurrentFormPage Method

Microsoft Outlook Visual Basic

Displays the specified form page in the inspector.

expression.SetCurrentFormPage(PageName)

expression    Required. An expression that returns an Inspector object.

PageName    Required String. The display name of the form page.

Example

This Visual Basic for Applications (VBA) example uses the SetCurrentFormPage method to show the All Fields page of the currently open item. If no items are currently open, a message box will inform the user.

Sub ShowAllFieldsPage()
 Dim myOlApp As New Outlook.Application
 Dim myInspector As Inspector
 Dim myItem As Object
 Set myInspector = myOlApp.ActiveInspector
 On Error GoTo ErrorHandler
 myInspector.SetCurrentFormPage ("All Fields")
 Set myItem = myInspector.CurrentItem
 myItem.Display
 Exit Sub
 ErrorHandler:
     MsgBox "No current item to display."
End Sub