AnsweredAssumed Answered

Macro to replace text does not work with special "symbols" in note?

Question asked by Albert Mejia on Feb 19, 2015
Latest reply on Jun 2, 2015 by Leon Wurr

Not a code expert but here is a part of what I have. It does work but will not work when the note has "Delta Flag Note Nmber",   "Surface finish Symbol", or "Feature Control Frame"

in the note. It will completely remove all the text in the note if it does.


Private Sub cmbRemove_Click()
Set swApp = _

Set Part = swApp.ActiveDoc
Part.Save2 False

'--------------------Find and Replace Annotations--------------------
Set swUtil = swApp.GetAddInObject("Utilities.UtilitiesApp")
Set swUtilFindReplaceAnnotations = swUtil.FindReplaceAnnotations
longstatus = swUtilFindReplaceAnnotations.InitPMPage()
#If 0 Then
#End If
'--------------------UnBlock Recording------------------
swUtilFindReplaceAnnotations.FindText = "(" + txtNumberX.Value + ")"
swUtilFindReplaceAnnotations.ReplaceText = ""
swUtilFindReplaceAnnotations.AnnotationFilter = gtFraNote
longstatus = swUtilFindReplaceAnnotations.FindNext()
longstatus = swUtilFindReplaceAnnotations.Replace()

'--------------------UnBlock Recording------------------

'longstatus = swUtilFindReplaceAnnotations.Close()

End Sub