VBA菜单
请问用VBA做的程序怎么把他写成菜单宏,直接用菜单或则工具按钮来执行的? 在AutoCAD目录下新建acad.dvb,运行AutoCAD自动加载后添加以下内容Sub MenuExtend()Dim currMenuGroup As AcadMenuGroup
For Each currMenuGroup In ACAD.Application.MenuGroups
If currMenuGroup.Name = "ACAD" Then
Exit For
End If
Next
Dim currMenu As AcadPopupMenu
Dim newMenuItem As AcadPopupMenuItem
For Each currMenu In currMenuGroup.Menus
If currMenu.Name = "文件(&F)" Then
Set newMenuItem = currMenu.AddMenuItem(19, "分页打印", "-VBARUN acad.dvb!Startup.PlotPaging" & Chr(32)) '具体参数根据你的需要定
End If
Next
End Sub在AutoCAD目录下新建acad.lsp,运行AutoCAD自动加载后添加以下内容(defun S::STARTUP()
(command "_-vbarun" "MenuExtend")
)
页:
[1]