SubMenu Property (ActiveX)

Gets the popup menu associated with a sub menu.

Supported platforms: Windows only

Signature

VBA:

object.SubMenu
object

Type: PopupMenuItem

The object this property applies to.

Property Value

Read-only: Yes

Type: PopupMenu

The popup menu associated with the sub menu.

Remarks

If the popup menu item is not a sub menu, this property returns an error.

Examples

VBA:

Sub Example_SubMenu()
    ' This example finds the menu used as the sub menu for the
    ' "Additional Resources" menu item in the Help menu.
    
    Dim acadMenuGroup As acadMenuGroup
    Set acadMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD")
    
    Dim helpMenu As AcadPopupMenu
    Set helpMenu = acadMenuGroup.Menus.Item("&Help")
    
    Dim menuItem As AcadPopupMenuItem
    Set menuItem = helpMenu.Item(4)
        
    Dim subMenu As AcadPopupMenu
    Set subMenu = menuItem.subMenu
    
    MsgBox "The name of the submenu is " & subMenu.TagString
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_SubMenu()
    ;; This example finds the menu used as the sub menu for the
    ;; "Additional Resources" menu item in the Help menu.
    (setq acadObj (vlax-get-acad-object))

    (setq acadMenuGroup (vla-Item (vla-get-MenuGroups acadObj) "ACAD"))
    
    (setq helpMenu (vla-Item (vla-get-Menus acadMenuGroup) "&Help"))
    
    (setq menuItem (vla-Item helpMenu 4))
        
    (setq subMenu (vla-get-SubMenu menuItem))
    
    (alert (strcat "The name of the submenu is " (vla-get-TagString subMenu)))
)