Thank you, macropod, for your code. I tried it on the test.docx I provided and it seems to work for the first line.
But then it seems to get stuck in this loop when it hits a particular wdColorAutomatic
Code:
Do While .End < Rng.End - 1
If .Characters.Last.Next.Font.Shading.BackgroundPatternColor = _
.Characters.First.Font.Shading.BackgroundPatternColor Then
.End = .End + 1
Else
Select Case .Font.Shading.BackgroundPatternColor
Case wdColorAutomatic
Case wdColorWhite: .Collapse wdCollapseEnd
Case Else
...
End Select
...