Dim aa As String
Dim bb As String
aa = "我的中國心"
bb = "長江,黃河"
Dim myselection As AcadSelectionSet
For Each myselection In ThisDrawing.selectionSets
If myselection.Name = "qqq" Then
myselection.Delete
Exit For
End If
Next
Set myselection = ThisDrawing.selectionSets.Add("qqq")
myselection.SelectOnScreen
Dim mytext As AcadMText
Dim myentity As AcadEntity
For Each myentity In myselection
If myentity.ObjectName = "AcDbMText" Then
Set mytext = myentity
If mytext.TextString = aa Then
mytext.TextString = bb
End If
A = A + 1
End If
Next
MsgBox A
End Sub