楼主好创意,我来试试
- 'EveryThing搜索文本
- 'By zzyong00 2016.10.23
- Dim objEnt As AcadEntity, pt1 As Variant
- Dim objT As AcadText, objMT As AcadMText
- Dim strCon As String
- On Error GoTo err1
- AppActivate objCad.Caption
- ThisDrawing.Utility.GetEntity objEnt, pt1, "请选择文本:"
- 'Debug.Print objEnt.ObjectName
- If objEnt.ObjectName = "AcDbText" Then
- Set objT = objEnt
- strCon = objT.TextString
- ElseIf objEnt.ObjectName = "AcDbMText" Then
- Set objMT = objEnt
- strCon = MtextStringClearFormat(objMT.TextString)
- Else
- End If
- Shell "C:\Program Files\Everything\everything -s " & Chr(34) & strCon & Chr(34)
- Exit Sub
- err1:
- If Err.Number = -2147352567 Then
- Err.Clear
- Else
- MsgBox Err.Description, vbOKOnly + vbCritical
- End If
|