The text is of type wdSelectionNormal
So, if you iterate over all the characters in a document and delete the “characters” that are of type 2 when selected. This will do the trick.
It doesn't have to be really fast, but it works.
This example answers simple cases:
Dim curCharIndex As Integer Dim charCount As Integer curCharIndex = 1 charCount = ActiveDocument.Characters.Count While curCharIndex <= charCount ActiveDocument.Characters(curCharIndex).Select If Selection.Type = wdSelectionNormal Then Selection.Delete charCount = charCount - 1 Else 'Skip it curCharIndex = curCharIndex + 1 End If Wend
source share