I often copy a web page to the clipboard, then paste it into ms word for further processing.
One particular website often contains many empty text boxes as seen here ee-ms-word-text-box-deletion.docx
MS Word treats the boxes as Fields, so I wrote the following code to delete these boxes.
' REPLACES ALL TEXTBOXES WITH VALUE
Dim rng As Range, sText As String
For Each rng In ActiveDocument.StoryRanges
While .Count > 0
' sText = .text ' tried a few variations like .code.text etc but could not find the magic properties to use.
' Selection.TypeText sText
I would like to modify the code so that it deletes the empty text boxes and replaces them with the inner text.
i use the following code that deletes all of these delete