I would like to hide the text that's is not highlighted in my document.
I've already code the part where I can't do it on "normal" text, but I got textboxes with highlighted text inside and I cant access to them.
I've try to do some research to get inside this text boxes but nothing works.
Here is my code :
Sub Hide_onCondition_RSO()
'
' Hide_RSO Macro
'
'
Dim eShape As Word.shape
Dim i As Long
For i = ActiveDocument.Shapes.Count To 1 Step -1
Set eShape = ActiveDocument.Shapes(i)
If eShape.Type = msoTextBox Then
With ActiveDocument.Content.Find
.Text = ""
.ClearFormatting
.Format = True
.Highlight = False
.Replacement.Text = ""
.Replacement.ClearFormatting
.Replacement.Font.Hidden = True
.Execute Replace:=wdReplaceAll
End With
End If
Next i
End Sub
Do you have some ideas ?
------------------------------ EDIT -----------------------------
When I try to loop around shapes, and try to access to the text frame of the shape to see if the text is highlighted or no, that the macro doesn't find them because maybe they are in a group (?).