此段VB代码为何只能提取数字型的文字,却提取不了中文的文本?
请高手帮忙!
On Error Resume Next Set acadApp = GetObject(, "AutoCAD.Application.16") If ERR Then ERR.Clear Set acadApp = CreateObject("AutoCAD.Application.16") If ERR Then End End If acadApp.Visible = True Dim acadDoc As AcadDocument acadApp.WindowState = acMax Set acadDoc = acadApp.ActiveDocument
Set excel = GetObject(, "Excel.Application") Set xlSheet = excel.ActiveWorkbook.Sheets("sheet1")
Dim a As Double Dim b As Double a = TextBox1.Text b = TextBox2.Text
acadDoc.Utility.GetEntity returnObj, basepnt, "选择文字:" If returnObj.ObjectName = "AcDbText" Or returnObj.ObjectName = "AcDbMText" Then ptcen = returnObj.TextString returnObj.Update xlSheet.Cells(a, b) = Round(ptcen) End If |