OL97: ShowFormPage/HideFormPage Changes Form's Message Class

Last reviewed: March 2, 1998
Article ID: Q174276
The information in this article applies to:
  • Microsoft Outlook 97

SYMPTOMS

If you use the ShowFormPage or HideFormPage methods of the Microsoft Outlook object model with a custom form, the Message Class field of the form will revert back to the default message class.

STATUS

This behavior is by design.

MORE INFORMATION

The ShowFormPage and HideFormPage methods can be used to display or hide one or more of a custom form's pages, such as "General" and "Details," on a contact form. These methods are typically used in Microsoft Visual Basic Scripting Edition (VBScript) to create "dynamic" forms that change based on some criteria.

Because these commands change the layout of the form, Outlook creates a one-off item and therefore the message class reverts back to the default message class for that type of item.

For more information about one-off forms, please see the following article in the Microsoft Knowledge Base:

   Article-ID: Q176567
   Title     : OL97: Working with Form Definitions and One-Off Forms

An item's message class indicates which form is associated with that particular item. For example, the message class of the default Outlook contact form is IPM.Contact, and the message class of a custom form based on the Contact form is IPM.Contact.<Form Name>.

For more information about message classes, please see the following article in the Microsoft Knowledge Base:

   Article-ID: Q170301
   Title     : OL97: How to Update Existing Items to Use a New Custom Form

Steps to Reproduce Problem

  1. Create a new, default Outlook contact form.

  2. On the form's Tools menu, click Design Outlook Form.

  3. On the Form menu, click View Code.

  4. Enter the following code into the Script Editor:

          Sub Item_Open()
             Item.GetInspector.ShowFormPage("P.2")
          End Sub
    
    

  5. On the File menu, click Publish Form As. Name the form "Test," make sure the contacts folder is selected as the destination, and then click Publish.

  6. Close and do not save changes to this contact item.

  7. On the Contacts menu, click New Test.

    The Item_Open event in the VBScript code will run.

  8. Click the All Fields tab, and click All Contact Fields in the Select From list.

  9. Note that the Message Class field is IPM.Contact.

REFERENCES

For more information about creating solutions with Microsoft Outlook 97, please see the following articles in the Microsoft Knowledge Base:

   Article-ID: Q166368
   Title     : OL97: How to Get Help Programming with Outlook

   Article-ID: Q170783
   Title     : OL97: Q&A: Questions about Customizing or
               Programming Outlook


Additional query words: OutSol OutSol97
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Solution Type : kbpending


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.