Displaying the Form's Pages

The pages of the EnhancedLitCrit form are displayed using the objects and methods of the Microsoft Outlook object model. Code similar to the following appears in several places in the EnhancedLitCrit script:

If Item.UserProperties("OldUserName")= CurrentUser AND UserProperties("bibNo") <> 0 Then
    MyInspector.ShowFormPage("HalfRead")
    MyInspector.HideFormPage("Others")
    MyInspector.HideFormPage("CurrentUser")
    MyInspector.SetCurrentFormPage("HalfRead")
    Set MyPage= MyInspector.ModifiedFormPages("HalfRead")
ElseIf . . . 

In the preceding code, if the original writer of the critique is reading it again, and if the title of the item critiqued is in the FmLib database, the HalfRead page is displayed. Half of this page — the item description — is read-only, and the other half, which displays the controls for rating the item and adding critique text, is read/write.

The GetInspector object of the Outlook object model represents the window in which an Outlook item (the form itself) is being displayed. Its ShowFormPage and HideFormPage methods are then called, which display the HalfRead page and hide the other pages of the form.

Note  Outlook requires that at least one page of a form be displayed at all times, whether the form is being created or run. This rule is followed in the preceding code by calling the ShowFormPage command before the HideFormPage command.

The ShowFormPage command displays the page of a form, while the SetCurrentFormPage command determines the page on which the script performs subsequent write and read actions.