jsxygshh 发表于 2012-10-8 17:46
谢谢你的提示,你的提示用过,由于本人技术较低没有调试成功,请帮忙在上面的代码中帮助添加一下,先表示 ... - Private Sub Command1_Click()
- Dim myAcadApp As AutoCAD.AcadApplication, activeDoc As AutoCAD.AcadDocument, acMS As AutoCAD.AcadModelSpace
- Dim ToolBar As AcadToolbar
- On Error Resume Next
- Set myAcadApp = GetObject(, "Autocad.Application")
- If Err <> 0 Then
- Err.Clear
- Set myAcadApp = CreateObject("Autocad.Application")
- If Err Then
- MsgBox Err.Number & ":" & Err.Description
- Exit Sub
- End If
- End If
- With myAcadApp
- .WindowState = acMax
- .Visible = True
- .ActiveDocument.SetVariable "MENUBAR", 0
- For Each ToolBar In .MenuGroups.Item("ACAD").Toolbars
- ToolBar.Visible = False
- Next
- End With
- AppActivate "AUTOCAD"
- End Sub
|