How can I start a procedure in a PopupMenu?

How can I start a procedure in a PopupMenu?

Anonymous
Not applicable
205 Views
1 Reply
Message 1 of 2

How can I start a procedure in a PopupMenu?

Anonymous
Not applicable
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
0 Likes
206 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Use this as your menu macro: -VBARUN TEST1 And make sure that the sub Test1 is public. -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Hartmut Callies" wrote in message news:40e471f7_2@newsprd01... > 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 > > >
0 Likes