Menus Property (ActiveX)

Gets the PopupMenus collection.

Supported platforms: Windows only

Signature

VBA:

object.Menus
object

Type: MenuGroup

The object this property applies to.

Property Value

Read-only: Yes

Type: PopupMenus

A user-specified variable declared as a PopupMenus collection.

Remarks

No additional remarks.

Examples

VBA:

Sub Example_Menus()
    ' This example finds the names of all menus in the first menu group.
    
    Dim menuNames As String
    Dim menuCollection As AcadPopupMenus
    Dim menu As AcadPopupMenu
    
    Set menuCollection = ThisDrawing.Application.MenuGroups.Item(0).Menus
    menuNames = ""
    For Each menu In menuCollection
        menuNames = menuNames & menu.name & vbCrLf
    Next menu
    MsgBox menuNames
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Menus()
    ;; This example finds the names of all menus in the first menu group.
    (setq acadObj (vlax-get-acad-object))    
    
    (setq menuCollection (vla-get-Menus (vla-Item (vla-get-MenuGroups acadObj) 0))
          menuNames "")
  
    (vlax-for menu menuCollection
        (setq menuNames (strcat menuNames (vla-get-Name menu) "\n"))
    )
  
    (alert menuNames)
)