How can I start a procedure in a PopupMenu?

Discussion in 'AutoCAD' started by Hartmut Callies, Jul 1, 2004.

  1. Hallo,
    I have with VBA in autocad 2004 write a modul. With the modul I create a
    PopupMenu.

    Sub StartPopupMenu ()
    Dim AcGroup As AcadMenuGroup
    Dim MMenu As AcadPopupMenu
    Dim MItem As AcadPopupMenuItem

    Set AcGroup = Application.MenuGroups ("acad")
    Set MMenu = AcGroup.Menus.Add ("TestMenu")
    Set MItem = MMenu.AddMenuItem (0, "Test", ???????????)
    End Sub

    Sub Test1 ()
    MsgBox "hallo"
    End Sub

    How can I start the procedure Test1 with the command: Set MItem =
    MMenu.AddMenuItem (0, "Test", ???????????) ?
    The procedure StartPopupMenu and Test1 are in the same modul.

    Thanks.


    Hartmut Callies
     
    Hartmut Callies, Jul 1, 2004
    #1
  2. Use this as your menu macro:

    -VBARUN TEST1

    And make sure that the sub Test1 is public.
     
    Tony Tanzillo, Jul 2, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.