Add Separators to a Menu

To add a separator to a menu, use the AddSeparator method. This method creates a new PopupMenuItem object and adds it to the designated menu. This kind of PopupMenuItem object is assigned the type of acSeparator. The type of a menu item can be found through the Type property.

The AddSeparator method takes the Index parameter as its only input. The Index parameter is an integer that specifies the position of the separator within the menu. The index begins with position zero (0) as the first position on the menu after the title.

See Enable and disable menu items for an example of adding separators to a menu.