View Single Post
 
Old 05-27-2020, 06:05 AM
alex100 alex100 is offline Windows 7 64bit Office 2016
Advanced Beginner
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default

Brilliant, thank you!

One more thing, and I'd like to point out that I'm asking this mostly because I know there will be other people that will find this thread and may use your code for themselves. Today I spend about half an hour searching Google for Word highlighters, and while I found quite many, almost no one had the ability to use RGB colors. Except for Greg's Highlighter, they all used the 'HighlightColorIndex' property.

As you wrote it, I understand that each keyword in the 'arrWords' array has a corresponding color in the 'Case 0,1,2,etc' RGB list. So there's a keyword/color pair, and I hope I'm not mistaken. Please let me know if I am.

Like me, I think most people who use such highlighters need to assign a single color to an entire list of keywords. Basically, you want ten keywords to be highlighted in red, 15 keywords in blue, and so on.

With this in mind, I think the best approach would be to have multiple arrays, each one with a corresponding color.

Something like this:

arrWords1 = Array("keyword1", "keyword2")
arrWords2 = Array("keyword1", "keyword2", "keyword3")
arrWords3 = Array("keyword1", "keyword2", "keyword3", "keyword4", "keyword5", "keyword6")

Then, the RGB list should basically assign one color to each array:

arrWords1: RGB (10, 175, 150)
arrWords2: RGB (74, 18, 188)
arrWords3: RGB (150, 175, 190)

What do you think? This is what I am looking for, and I'm sure this solution would be the closest one to most user's needs.

Most probably, this is just a minor change to your code, but with lots of added value.

Alex
Reply With Quote