Hello,
I am looking for a macro to highlight in a MS Word document different words in different colors using a userform or search box.
Any help would be highly appreciated!
N
Hello,
I am looking for a macro to highlight in a MS Word document different words in different colors using a userform or search box.
Any help would be highly appreciated!
N
Is there a reason you can't just use Find/Replace for this?
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Because I have many keywords and their synonyms and I would like to search and highlight them in different colors at once.
N
The following macro uses Find/Replace on three different arrays to variously highlight/un-highlight and change the highlight colour of a range of words & strings.
Simply replace the array terms with your own for the word and its synonyms and change the highlight settings to whatever you'd prefer. You can also add more of the array & For ... Next blocks.Please Login or Register to view this content.
Hi,
I really appreciate your help. I was wondering whether this could be also soved by using a textbox (see image) where 5 different highlighting colors would be assigned to the 5 different groups of words.
Thank you so much in advance
N
Textbox.PNG
Yes, that could be done, but the code would have to be completely re-written around the use of a userform. Furthermore, your form mockup doesn't provide for the user to choose the highlight colour for any of the options.
For flexibility, without the need for a userform, try:
Please Login or Register to view this content.
Hi ,
I think, for this purpose, the use of a userform would be mre appropriate, since I can have 5 different groups of words, and all words within a group must have a same color.
The user doesn't need to choose a color, because the color of the different groups will be fixed, i.e for the group 1 we use "yellow", for the group 2 "Bright Green", for the group 3 "Turquoise", for the group 4 "Pink", for the group 5 "Gray 50".
Thanks very much for trying to write the code around a userform.
N
I can imagine that you don't have the time, I fully understand that, and that's why I am asking for a bit of help with the userform, and I will then finish it.
Much appreciated!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks