zzhzq_1234 发表于 2006-9-17 21:43:00

[VBA]有点意思啊?

<P>各位高手 帮小弟指点一二啊<BR><BR>在使用如下程序后就重新启动Autocad后<BR><BR>菜单栏就只剩下《文件》、《视图》、《窗口》、《帮助》了&nbsp;&nbsp;其他的什么都没有了哦<BR><BR>请问各位如何恢复啊? </P>

<P>程序如下:<BR>Sub InsertMenu()<BR>'difine a variable for the current menu group<BR>Dim currMenuGroup As AcadMenuGroup<BR>Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)<BR><BR>'create a new menu<BR>Dim newMenu As AcadPopupMenu<BR>Set newMenu = currMenuGroup.Menus.Add("驱动")<BR><BR>'declare the variable for the menu item<BR>Dim newMenuItem As AcadPopupMenuItem<BR>Dim LineDrive As String<BR>Dim CirCleDrive As String<BR>Dim ItemNum As Integer<BR><BR>LineDrive = Chr(3) + Chr(3) + Chr(95) + "zq.show" + Chr(32)<BR>Set newMenuItem = newMenu.AddMenuItem(newMenu.Count + 1, "直线驱动", LineDrive)<BR>currMenuGroup.Menus.InsertMenuInMenuBar "驱动", ""<BR>If MsgBox("Delete the Menu?", vbYesNo + vbQuestion, "Asking") = vbYes Then<BR>&nbsp; &nbsp;&nbsp;&nbsp;ItemNum = ThisDrawing.Application.MenuGroups.Count - 1<BR>&nbsp; &nbsp;&nbsp;&nbsp;currMenuGroup.Unload<BR>End If<BR>End Sub </P>

<P>就是使用了<BR>currMenuGroup.Unload 后出现的 <BR>请问如何恢复<BR>谢谢各位了 </P>

xnn2004 发表于 2006-9-19 15:58:00

输入命令menu,加载acad.mnu,位置在D:\Documents and Settings\Administrator\Application Data\Autodesk\AutoCAD 2005\R16.1\chs\Support

zzhzq_1234 发表于 2006-9-19 20:16:00

<P>问题已经解决了 谢谢</P>
页: [1]
查看完整版本: [VBA]有点意思啊?