Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 07-09-2014, 11:28 PM
gekser gekser is offline Highlighting multiple word instances in text Windows 7 64bit Highlighting multiple word instances in text Office 2013
Novice
Highlighting multiple word instances in text
 
Join Date: Jul 2014
Posts: 5
gekser is on a distinguished road
Default What about that macro

Dear Paul, thank you for prompt reply.

Somewhere in the Internet I found the following macro.

Code:
Sub HighlightRepeatedWords()
'
' HighlightRepeatedWords
'
Dim oRng As Word.Range
Dim arrWords
Dim i As Long
arrWords = Array("work", "dialogue", "would like", "first of all")
For i = 0 To UBound(arrWords)
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = arrWords(i)
    .MatchWholeWord = False
    .Replacement.Highlight = True
    ' .MatchCase = True
    .Execute Replace:=wdReplaceAll
  End With
Next
End Sub
It was yours but with a different name. My task is to use not just 4 (four) words as an array but 160. VB does not allow me to use so many words in a single string.

I do not mind if all of the words needed are highlighted by one color.

Could you suggest what to do in this case?
Reply With Quote
 

Tags
highlight cognate words



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple identities in separate Outlook instances? brucemc777 Outlook 3 07-08-2014 10:36 PM
Highlighting multiple word instances in text multiple instances available? Guloluseus Project 3 01-31-2014 02:42 PM
Word 2010 running multiple instances JBE Word 0 09-28-2012 06:00 PM
Highlighting multiple word instances in text Email Duplicates & Multiple Instances Running trim Outlook 2 03-13-2012 11:25 AM
Text Highlighting in Yellow ??? mark4man Publisher 0 12-15-2005 06:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft