@מלאכת-מחשבת
הקוד הוא:
Sub הוספת_קודים()
Application.ScreenUpdating = False
again:
If Selection.Find.Execute(findText:="\(*\)", MatchWildcards:=True, Wrap:=wdFindStop) = True Then
strt = 2: lent = Len(Selection.Text)
re:
For i = strt To lent
If Mid(Selection.Text, i, 1) = Chr(40) Then
Selection.Extend Character:=Chr(41)
strt = i + 1: lent = Len(Selection.Text)
GoTo re
End If
Next
With Selection
.InsertBefore "@00": .InsertAfter "@01"
.Collapse (wdCollapseEnd)
End With
GoTo again
End If
Application.ScreenUpdating = True
End Sub
ויש להתאימו לפי הצורך. אשמח לשמוע על שיפורים או אם יהיו באגים...