Delete text frames and text

L

Legal Learning

Using Word 2003: I am trying to delete all text frames and the text in
documents. I have tried various For Next routines that have deleted only
some of the frames but have left bordered text in their place. Help!!
 
S

Stefan Blom

To delete all frames and preserve the text, you can select the whole
document and press Ctrl+Q. If frame formatting was applied via styles,
just clear the frame via the Modify Style dialog box.

To clear all frames and their text, you can use the following macro:

Sub RemoveFrames()
Dim f As Frame
For Each f In ActiveDocument.Content.Frames
f.Range.Text = ""
f.Delete
Next f
End Sub

To remove all text boxes, including their contents:

Sub DeleteTextBoxes()
Dim s As Shape
For Each s In ActiveDocument.Shapes
If s.Type = msoTextBox Then
s.Delete
End If
Next s
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top