把AutoCAD字导入excel
Sub dd()Dim elem As Object
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.application")
Set xlBook = xlApp.Workbooks.Open("E:\123.xls")
Set xlSheet = xlBook.Sheets(1)
For Each elem In ThisDrawing.ModelSpace
With elem
If (elem.EntityName = "AcDbText") Or (.EntityName = "AcDbMText") Then
xlSheet.cells(1, 1) = .TextString
xlApp.Visible = True
End If
End With
Set elem = Nothing
Next elem
End Sub
感谢分享,来参考一下
页:
[1]