Forum Discussion
jellow1155
Jun 13, 2023Copper Contributor
How to add color to index entries in a Word File
My book has an index, but when "Show" is toggled, it is hard to read the text with so many index entries. I am hoping it is possible to color the index entries so that they can either be ignored to r...
Charles_Kenyon
Jul 13, 2023Bronze Contributor
That is because the Index is created using the individual entries. There is no link from the index back to those entries. Changes made in the Index are lost next time it is updated.
Coloring the individual entries is ingenious, even though that will also be a lot of work.
Coloring the individual entries is ingenious, even though that will also be a lot of work.
Jay Freedman
Jul 13, 2023Brass Contributor
Coloring all the entries doesn't have to be a lot of work. Just run this macro:
Sub Color_Index()
Dim oFld As Field
Dim oIdx As Index
For Each oFld In ActiveDocument.Fields
If oFld.Type = wdFieldIndexEntry Then
oFld.Code.Select
Selection.Font.ColorIndex = wdRed
End If
Next oFld
For Each oIdx In ActiveDocument.Indexes
oIdx.Update
Next oIdx
End Sub- jellow1155Jul 14, 2023Copper ContributorAwesome! Thanks!