Link to home
Start Free TrialLog in
Avatar of techtrainlady
techtrainlady

asked on

Delete all text boxes in Word 2010

How do you delete all text boxes and their contents in Word 2010?  I am guessing I will need a macro to remove them all.
Avatar of Steven Harris
Steven Harris
Flag of United States of America image

Are they drawing text boxes?

Sub Q_28250528()
       Dim wShp As Word.Shape
       Dim i As Long
       For i = ActiveDocument.Shapes.Count To 1 Step -1
       Set wShp = ActiveDocument.Shapes(i)
          If wShp.Type = msoTextBox Then
               wShp.Delete
          End If
       Next i
End Sub

Open in new window

Avatar of techtrainlady
techtrainlady

ASKER

It worked beautifully!  I removed all text boxes and contents from a 160 page document in a second!
ASKER CERTIFIED SOLUTION
Avatar of Steven Harris
Steven Harris
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial