Example

This example clears all existing menus and creates two menus with one item each; the File menu with the Exit command, and the Macro menu with the Macros command.

Sub MenuDemo()

 With Session

  .MenuVisible = True

  .ClearMenu

  .InsertPopupItem rcFilePopup, rcMainMenu, rcLastItem, "", "", ""

  .InsertPopupItem rcExitItem, 1, rcLastItem, "", "", ""

  .InsertPopupItem rcMacroPopup, rcMainMenu, rcLastItem, "", "", ""

  .InsertPopupItem rcMacrosDlgItem, 2, rcLastItem, "", "", ""

 End With

End Sub