以下代码能打开程序,但打不开图纸文档,请帮看看是什么问题?
PrivateSubButton2_Click(senderAsObject, eAsEventArgs)HandlesButton2.Click
DimAcadAppAsAutodesk.AutoCAD.Interop.AcadApplication
DimAcadDocAsAutodesk.AutoCAD.Interop.AcadDocument
OnErrorResumeNext
AcadApp = GetObject(,"AutoCAD.Application")
IfErr.NumberThen
Err.Clear()
AcadApp = CreateObject("AutoCAD.Application")
IfErr.NumberThen
MsgBox("Con not Get or Create AutoCAD Object! Please check whether the AutoCAD has installed.")
EndIf
EndIf
AcadApp.Visible =True
AcadApp.Documents.Open("D:\stmal\drawing1.dwg")
EndSub
PrivateSubButton2_Click(senderAsObject, eAsEventArgs)HandlesButton2.Click
DimAcadAppAsAutodesk.AutoCAD.Interop.AcadApplication
DimAcadDocAsAutodesk.AutoCAD.Interop.AcadDocument
OnErrorResumeNext
AcadApp = GetObject(,"AutoCAD.Application")
IfErr.NumberThen
Err.Clear()
AcadApp = CreateObject("AutoCAD.Application")
IfErr.NumberThen
MsgBox("Con not Get or Create AutoCAD Object! Please check whether the AutoCAD has installed.")
EndIf
EndIf
AcadApp.Visible =True
AcadApp.Documents.Open("D:\stmal\drawing1.dwg")
EndSub