I
ivanov.ivaylo
Greetings,
Can someone help me modify the macro below?
I have a list of words which must be tagged like this: [c]XXXX[/c]
I have a macro that I used a while ago which served me to colorize
these words in green. Can you help me modify this macro or use another
that looks for a word in the list and puts the tags [c] and [/c]
around it, then looks for the next word in the list, etc.
Hwre is my old macro:
Sub Colorize()
Dim sKeywords As Variant
Dim i As Long
Dim sKeywords As Variant
Dim i As Long
sKeywords = Array("abbr", "adj", "adv", "am", "attr", "aux", "cj",
"comp", "demonstr", _
"ger", "imp", "impers", "indef. art.", "inf", "int", "inter", "lat",
"n", "num", _
"part", "pers", "pl", "poss", "pp", "predic", "pref", "prep", "pres
p", "pron", "pt", "refl", "sing", "sl", "suf", "v")
For i = LBound(sKeywords) To UBound(sKeywords)
With ActiveDocument.Content.Find
.ClearFormatting
.Text = sKeywords(i)
.Font.Italic = True
.Format = True
.MatchWholeWord = True
.MatchCase = True
With .Replacement
.ClearFormatting
.Font.Color = wdColorGreen
Thank you very much!
End With
.Execute Replace:=wdReplaceAll
End With
Next i
End Sub
Can someone help me modify the macro below?
I have a list of words which must be tagged like this: [c]XXXX[/c]
I have a macro that I used a while ago which served me to colorize
these words in green. Can you help me modify this macro or use another
that looks for a word in the list and puts the tags [c] and [/c]
around it, then looks for the next word in the list, etc.
Hwre is my old macro:
Sub Colorize()
Dim sKeywords As Variant
Dim i As Long
Dim sKeywords As Variant
Dim i As Long
sKeywords = Array("abbr", "adj", "adv", "am", "attr", "aux", "cj",
"comp", "demonstr", _
"ger", "imp", "impers", "indef. art.", "inf", "int", "inter", "lat",
"n", "num", _
"part", "pers", "pl", "poss", "pp", "predic", "pref", "prep", "pres
p", "pron", "pt", "refl", "sing", "sl", "suf", "v")
For i = LBound(sKeywords) To UBound(sKeywords)
With ActiveDocument.Content.Find
.ClearFormatting
.Text = sKeywords(i)
.Font.Italic = True
.Format = True
.MatchWholeWord = True
.MatchCase = True
With .Replacement
.ClearFormatting
.Font.Color = wdColorGreen
Thank you very much!
End With
.Execute Replace:=wdReplaceAll
End With
Next i
End Sub