一. 連接到現(xiàn)有文檔
Dim swApp As SldWorks.SldWorks
Dim part As ModelDoc2
Dim longstatus As Boolean
Set swApp = Application.SldWorks
Set part = swApp.ActiveDoc
二. 以模板形式打開文檔
Dim swApp As SldWorks.SldWorks
Dim part As ModelDoc2
Dim longstatus As Boolean
Set swApp = Application.SldWorks
Set part = swApp.NewDocument(模板名, 大小, 寬-doouble, 高-double)
打開零件文檔可以 將模板名寫成路徑,大小寬高為0
三. 打開文檔
Dim swApp As SldWorks.SldWorks
Dim part As ModelDoc2
Dim longstatus As Boolean
Set swApp = Application.SldWorks
Set part = swApp.OpenDoc6(FileName, Type, Options, Configuration, Errors, Warnings)