在用VBA开发时,如何在窗体上创建菜单栏呢?
在用VBA开发时,如何在窗体上创建菜单栏呢?急需帮忙解决,谢谢! <P>创建菜单栏这个简单的问题我替高手给你回答:<BR>Sub AddMenuItem()</P><P> Dim currMenuGroup As AcadMenuGroup<BR> Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)<BR> <BR> 创建新菜单<BR> <BR>Dim newMenu As AcadPopupMenu<BR> Set newMenu = currMenuGroup.Menus.Add("新菜单")<BR>添加菜单内容<BR>Dim newMenuItem As AcadPopupMenuItem<BR> Dim macro As String<BR> macro = Chr(vbKeyEscape) + Chr(vbKeyEscape) '相当于按下两次Esc键<BR>Dim menuItemOpen As AcadPopupMenuItem<BR> Set menuItemOpen = newMenu.AddMenuItem(newMenu.Count + 1, "打开", macro & "_open ")<BR>这里写了个“打开”文件的菜单,你要做别的,改改部分代码即</P> <P>I think he want to create menus in user forms.</P> <A name=31921><FONT color=#000066><B>中世纪骑士</B></FONT></A> 可以和我联系吗?QQ:81234115
页:
[1]