![]() |
|
#1
|
|||
|
|||
![]()
If anyone can find the time, do you know how I can change this macro below from making the selected text bold to higlight red? Simply change it to ".Replacement.HighlightColorIndex = wdRed: .Replacement.Highlight = True" doesn't word for some reason. Thanks for your time!
Sub LinkingWords_SelectedText_Bold() Dim vWords As Variant Dim sWord As Variant ' Split the words into smaller arrays vWords = Array( _ Array("in spite of", "while", "whereas", "though", "admittedly", "regardless"), _ Array("So", "To summarize", "On the other side", "In conclusion", "Lastly", "In conclusion", "In short")) ' Process each sub-array separately For Each subArray In vWords For Each sWord In subArray Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Font.Bold = True With Selection.Find .Text = sWord .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = True .MatchCase = False .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Next sWord Next subArray End Sub |
![]() |
Tags |
find, highlight, macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
karkey | Word VBA | 3 | 01-05-2021 02:13 PM |
![]() |
abhimanyu | Word VBA | 5 | 03-20-2020 01:33 PM |
How to find (highlight) two and more words in a list of 75k single words in Word 2010 | Usora | Word | 8 | 05-29-2018 03:34 AM |
![]() |
bakerkr | Word VBA | 4 | 10-19-2017 02:23 PM |
![]() |
RBLampert | Word VBA | 13 | 10-23-2012 04:45 PM |