OL2002: Form Menu and Layout Menu Appear When You Use a Custom Form

This article was previously published under Q291421
This article has been archived. It is offered "as is" and will no longer be updated.
When you use a custom Microsoft Outlook form, both the Form menu and the Layout menu appear at the top of the form.
You can workaround this problem by adding Visual Basic Scripting Edition (VBScript) code to the form that will programmatically remove the Form and Layout menus when an item is opens. The following code will accomplish this:
Sub Item_Open()   FormMenusVisible FalseEnd SubSub Item_Close()   FormMenusVisible TrueEnd SubSub FormMenusVisible(boolVisible)   Dim objCommandBar   Dim objCBMenu     Set objCommandBar = Item.GetInspector.CommandBars.Item("Menu Bar")   Set objCBMenu = objCommandBar.FindControl(, 30145)   objCBMenu.Visible = boolVisible   Set objCBMenu = objCommandBar.FindControl(, 30146)   objCBMenu.Visible = boolVisible   Set objCBMenu = Nothing   Set objCommandBar = NothingEnd Sub				
NOTE: This code will also hide the two menus when you enter form design mode. To work around this side effect you can hold down the Shift key when opening the form to prevent the code from running.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Both the Form and Layout menus ought to only appear when the form is in design mode. However, if you change any of the default actions on a form, the menus also appear when you use the form. Most of the commands on each of these menus are disabled, so you cannot perform any actions by using these menus. However, the one exception is the View Code command, which means that users of the form can easily access and view custom script written in Visual Basic Scripting Edition (VBScript) behind a custom Outlook form.

NOTE: This behavior does not occur in Outlook 97 or Outlook 98, but does occur in Outlook 2000.
For additional information about available resources and answersto commonly asked questions about Microsoft Outlook solutions, click the article number below to view the article in the Microsoft Knowledge Base:
287530 OL2002: Questions About Custom Forms and Outlook Solutions
OutSol OutSol2002

Article ID: 291421 - Last Review: 10/23/2013 17:00:03 - Revision: 1.3

  • Microsoft Outlook 2002 Standard Edition
  • kbnosurvey kbarchive kbbug kbnofix KB291421