View Single Post
 
Old 07-06-2020, 10:48 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You were almost right


Code:
Sub MarkIndexMacro()
Dim myRange As Range
    Set myRange = ActiveDocument.Range
    With myRange.Find
        .Text = ""
        .Font.ColorIndex = wdRed
        Do While .Execute
            ActiveDocument.Indexes.MarkEntry Range:=myRange, Entry:=myRange.Text
            myRange.Collapse 0
        Loop
    End With
    Set myRange = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote