H
Helmut Weber
Hi Marco,
For 3 alternating colors, like this:
For i = 1 To 3
If i Mod 2 = 0 Then ' even numbers
'ColorWords Trim(arrKeyWords(i)), wdColorBlack, wdYellow
MsgBox "Yellow"
ElseIf i Mod 3 = 0 Then ' numbers that can be divided
' by 3 without remainder
'ColorWords Trim(arrKeyWords(i)), wdColorBlack, wdRed
MsgBox "red"
Else
'ColorWords Trim(arrKeyWords(i)), wdColorBlack, wdBlue
MsgBox "blue"
End If
Next
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
I was wondering when you have a lot of words to search on. Can you give
them different colours?
For i = 0 To UBound(arrKeyWords)
If arrKeyWords(i) <> "" Then
ColorWords Trim(arrKeyWords(i)), wdColorBlack, wdYellow
End If
Next i
For 3 alternating colors, like this:
For i = 1 To 3
If i Mod 2 = 0 Then ' even numbers
'ColorWords Trim(arrKeyWords(i)), wdColorBlack, wdYellow
MsgBox "Yellow"
ElseIf i Mod 3 = 0 Then ' numbers that can be divided
' by 3 without remainder
'ColorWords Trim(arrKeyWords(i)), wdColorBlack, wdRed
MsgBox "red"
Else
'ColorWords Trim(arrKeyWords(i)), wdColorBlack, wdBlue
MsgBox "blue"
End If
Next
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"