שימושי למעמדים בוורד ולהכנת קובץ לתג.
המאקרו עובר מן הסמן והלאה, מחפש סוגריים עגולים ותכולתו ומקטין אותם ב-2 נקודות.
המאקרו עובר מן הסמן והלאה, מחפש סוגריים עגולים ותכולתו ומקטין אותם ב-2 נקודות.
- אם רוצים גם להכניס קוד לפני ואחרי הסוגריים, יש להסיר ה'גרש' מתחילת השורה הצבוע באדום. וכמובן לערוך הקודים.
- אם רוצים גם לצבוע טקסט המוסגר כחול, יש להסיר ה'גרש' מתחילת שורה הכחול דלהלן.
קוד:
Sub round_brackets()
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
[COLOR=DarkRed]'.InsertBefore "@00": .InsertAfter "@01"[/COLOR]
.Font.SizeBi = .Font.SizeBi - 2
[COLOR=Blue]'.Font.Color = wdColorBlue[/COLOR]
.Collapse (wdCollapseEnd)
End With
GoTo again
End If
Application.ScreenUpdating = True
End Sub