Hi
I got the following bit of code from Curtis Waguespack. The only change I made from his original code is the loop at the end.
It will change everything based on your search string, but perhaps you can change it to suit your needs?
Sub MAIN ()
oDoc = ThisDoc.Document
Dim oSheets As Sheets
Dim oSheet As Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
Dim oGeneralNotes As GeneralNotes
Dim oGeneralNote As GeneralNote
Dim oSymbol As SketchedSymbol
Dim oSymbols As SketchedSymbols
Dim oTitleBlock As TitleBlock
'Dim oTestBox As TextBox
Dim TXT2Find As String
Dim NewTXT As String
'get user input
TXT2Find = InputBox("Enter Text To Find:", "iLogic", "XXX")
'look for blank value
If TXT2Find ="" Then
Return 'exit rule
Else
'Continue rule
End If
NewTXT = InputBox("Enter Text To Replace '"& TXT2Find _
& "' with.", "iLogic", "****")
'look for blank value
If NewTXT ="" Then
Return 'exit rule
Else
'Continue rule
End If
oSheets = oDoc.Sheets
For Each oSheet In oSheets
'handle errors
On Error Resume Next
'look at gerenal notes
oGeneralNotes = oSheet.DrawingNotes.GeneralNotes
For Each oGeneralNote In oGeneralNotes
If oGeneralNote.FormattedText = TXT2Find Then
oGeneralNote.FormattedText = NewTXT
Else
End If
Next
'look at leader notes
oLeaderNotes = oSheet.DrawingNotes.LeaderNotes
For Each oLeaderNote In oLeaderNotes
If oLeaderNote.FormattedText = TXT2Find Then
oLeaderNote.FormattedText = NewTXT
Else
End If
Next
'look at title blocks
oTitleBlock = oSheet.TitleBlock
For Each oTextBox In oTitleBlock.Definition.Sketch.TextBoxes
If oTitleBlock.GetResultText(oTextBox) = TXT2Find Then
oTitleBlock.SetPromptResultText(oTextBox, NewTXT )
Else
End If
Next
'look at sketched symbols
oSymbols = oSheet.SketchedSymbols
For Each oSymbol In oSymbols
For Each oTextBox In oSymbol.Definition.Sketch.TextBoxes
If oSymbol.GetResultText(oTextBox) = TXT2Find Then
oSymbol.SetPromptResultText (oTextBox, NewTXT)
Else
End If
Next
Next
Next
oAgain=MessageBox.Show("Again", "Rinse and Repeat",MessageBoxButtons.YesNo, MessageBoxIcon.Question) 'Added rev2
If oAgain=vbYes
AGAIN
End If
End Sub
Sub AGAIN
MAIN
End Sub
Reg
2026.1