VBA代码如下: Sub myHelp() UserForm1.Show End Sub
Public Sub CreateToolbar() Dim MenuGroupObject As AcadMenuGroup Dim ToolbarObject As AcadToolbar Dim ToolbarItemObject As AcadToolbarItem Dim ButtonObject As AcadToolbarItem
Set MenuGroupObject = ThisDrawing.Application.MenuGroups.Item(0) Set ToolbarObject = MenuGroupObject.Toolbars.Add("图标内容输入") Set ButtonObject = ToolbarObject.AddToolbarButton(0, "帮助", "帮助", "-vbarun myHelp" & vbCr) ToolbarObject.Visible = True End Sub
在drawing1.dwg中加载test.dvb程序,运行到myHelp()时能正常弹出UserForm1窗口,可是在drawing2.dwg中加载test.dvb程序时,运行时命令行没显示出错,也不弹出UserForm1窗口,为什么呢?怎么办呢?