Private Sub OpDWG_Click(Index As Integer)
Dim FF As AcadDocument
With ThisDrawing
Set FF = .Application.Documents.Item(OpDWG(Index).Caption) '将文件置为当前
FF.Activate
End With
End Sub
Sub DWG_VBA()
'Dim FF As AcadDocument
Dim Dwg_Name As String
Dim Dvb_Name As String
With ThisDrawing
For i = 0 To Application.Documents.Count - 1
'Set FF = .Application.Documents.Item(i)
If .Application.Documents.Item(i).FullName = "" Then '获得已经打开的文件
Dwg_Name = Dwg_Name & vbCrLf & .Application.Documents.Item(i).Name
Else
Dwg_Name = Dwg_Name & vbCrLf & .Application.Documents.Item(i).FullName
End If
Next i
MsgBox Dwg_Name
End With
With ThisDrawing.Application.VBE
For T1 = 1 To .vbprojects.Count
If .vbprojects(T1).FileName = "" Then
Dvb_Name = Dvb_Name & vbCrLf & .vbprojects(T1).Name '获得已加载的DVB文件
Else
Dvb_Name = Dvb_Name & vbCrLf & .vbprojects(T1).FileName
End If
Next T1
MsgBox Dvb_Name
End With
End Sub