求助~!!~!~vba中写autocad的3级菜单!~
<P>Option Explicit<BR>Public DirPath As String</P><P><BR>Sub AddASubMenu()<BR> '获得当前的菜单组<BR> Dim currMenuGroup As AcadMenuGroup<BR> Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)<BR> ' 创建新菜单<BR> Dim newMenu As AcadPopupMenu<BR> Set newMenu = currMenuGroup.Menus.Add("ttttttttttttt(&K)" & Chr(Asc("&")))<BR> '添加菜单项<BR> Dim macro As String<BR> macro = Chr(vbKeyEscape) + Chr(vbKeyEscape) '相当于按下两次Esc键<BR> '--------------------------------------------------------------------------------------<BR> '创建知识库(&C)<BR> Dim ID_Create As AcadPopupMenuItem<BR> Set ID_Create = newMenu.AddMenuItem(newMenu.Count + 1, Chr(Asc("&")) & "创建知识库(&C)", macro & "_open ")<BR> '分隔线<BR> Dim menuItemSeparator As AcadPopupMenuItem<BR> Set menuItemSeparator = newMenu.AddSeparator(newMenu.Count + 1)<BR> <BR> '--------------------------------------------------------------------------------------<BR> '知识查询(&Q)<BR> Dim ID_Query As AcadPopupMenu<BR> Set ID_Query = newMenu.AddSubMenu(newMenu.Count + 1, Chr(Asc("&")) & "知识查询(&Q)")<BR> '子菜单项目1:设计手册<BR> Dim ID_book As AcadPopupMenuItem<BR> Set ID_book = ID_Query.AddMenuItem(ID_Query.Count + 1, Chr(Asc("&")) & "设计手册(&B)", macro & "-vbarun" + Chr(32) + "ThisDrawing.vbahelp" + Chr(32))<BR><BR> ' 在菜单栏上显示菜单<BR> newMenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.Count + 1)<BR> <BR> <BR>End Sub</P>
<P>我想在 子菜单项目1:设计手册 后面在加上一个3级菜单 螺丝手册。。铸件手册。。等等</P>
<P>望会人告诉我怎么写!~!谢谢楼主!~</P> 提示:ThisDrawing.vbahelp的宏找不到!
页:
[1]