|
Private Sub ReplaceTextInDwg(ByVal strDwgName As String, ByVal strFind As String, ByVal strReplace As String)
'ReplaceTextInDwg函数用于打开指定的图形,用objdbx技术来完成文字的查找和替换
objDBX.Open strDwgName
Dim ent As AcadEntity
For Each ent In objDBX.ModelSpace
If TypeOf ent Is AcadText Or TypeOf ent Is AcadMText Then
With ent
If InStr(.TextStrig, strFind) Then .TextString = ReplaceStr(.TextString, strFind, strReplace, False)
End With
End If
Next ent
objDBX.SaveAs strDwgName
End Sub
运行到 If InStr(.TextStrig, strFind) Then这里的时候报错,有哪个高手可以告诉我原因吗?
ytusqwzimdk.png
|
|