Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 10-02-2019, 12:03 PM
poggyton poggyton is offline How to point a macro that highlights from a string of words at the footnotes rather than main doc Windows 10 How to point a macro that highlights from a string of words at the footnotes rather than main doc Office 2016
Novice
How to point a macro that highlights from a string of words at the footnotes rather than main doc
 
Join Date: Oct 2019
Posts: 3
poggyton is on a distinguished road
Thumbs up

Quote:
Originally Posted by gmaxey View Post
Code:
Sub HiLightList()
Application.ScreenUpdating = False
Dim StrFnd As String, Rng As Range, i As Long
StrFnd = "dog,cat,pig,horse,man"
For i = 0 To UBound(Split(StrFnd, ","))
  Set Rng = ActiveDocument.StoryRanges(wdFootnotesStory)
  With Rng.Find
    .ClearFormatting
    .Text = Split(StrFnd, ",")(i)
    .Replacement.ClearFormatting
    .Replacement.Highlight = True
    .Replacement.Text = "^&"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = True
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = True
    .Execute Replace:=wdReplaceAll
  End With
Next
Set Rng = Nothing
Application.ScreenUpdating = True
End Sub
That's awesome, thank you so much! I really appreciate it
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to point a macro that highlights from a string of words at the footnotes rather than main doc Looking for certain words in a string Guinness Excel 13 08-09-2019 08:50 AM
Word VBA_find string against bullet point Mahesh Word VBA 2 01-19-2018 03:27 AM
How to point a macro that highlights from a string of words at the footnotes rather than main doc Adding spaces only between each main bullet point dylansmith Word 2 09-02-2015 05:14 AM
Can you align the starting point of footnotes in multi-column format? New Daddy Word 1 11-10-2012 01:54 AM
How to make words hot and point to a web address? jlp Word 2 05-27-2012 01:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:08 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