本帖最后由 作者 于 2007-4-19 10:54:08 编辑
各位高手: 我有一段创建工具条的程序,也有段VBA运行对话框的程序,我想把弹出对话框的功能在工具条里实现请高手指点,不甚感激!!!! Sub InsertMenuItem() '定义变量 Dim CurrMenuGroup As AcadMenuGroup Dim MenuItem As AcadPopupMenuItem Dim MacroStr As String Dim NewMenu As AcadPopupMenu '设置下拉菜单群组 Set CurrMenuGroup = ThisDrawing.Application.MenuGroups.Item(0) '创建新F拉菜单列 Set NewMenu = CurrMenuGroup.Menus.Add("我的菜单项") '指定宏字符串"E5C Esc-DPEN"的vB对应值 MacroStr = Chr(3) + Chr(3) + Chr(95) + "open" + Chr(32) Set MenuItem = NewMenu.AddMenuItem(NewMenu.Count + 1, "打开", MacroStr) CurrMenuGroup.Menus.InsertMenuInMenuBar "打开", 0 End Sub Sub NewMenuItem() '定义变量 Dim NewMenuGroup As AcadMenuGroup Dim NewMenu As AcadPopupMenu Dim NewMenuItem As AcadPopupMenuItem Dim MacroStr As String Set CurrMenuGroup = ThisDrawing.Application.MenuGroups.Item(0) Set NewMenu = CurrMenuGroup.Menus.Add("我的菜单项") MacroStr = Chr(3) + Chr(3) + Chr(95) + "open" + Chr(3) Set MenuItem = NewMenu.AddMenuItem(NewMenu.Count + 1, "打开", MacroStr) NewMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.Count + 1) End Sub
如何和下面代码集成起来 |