Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I wonder if anybody can help me with a way to remove the text boxes from a Word document while keeping the text that is inside them.We often have to deal with files with 100s of text boxes in and currently manually copy the text out of the text box and then delete it.
Is there a method or a macro that anyone knows of that may be quicker at removing the text box while keeping the text?
Thanks for any help.

As far as I know there is no way to remove a text box w/o removing the text with it. But I do have a few questions:
Is this is some kind of form that people fill out?
Are the text boxes connected?

Do you need to remove the box, or do you just want the borders to be invisible?
Life is more painless for those who are brainless.

This is basically my first Word macro, so take it for what it is worth. This code assumes that you are really working with text boxes, which in Word would have names like Text Box 1, Text Box 2, etc.
The code looks at all the shapes in the document and if the shape has a name like Text Box X, it cuts the text out, deletes the shape and pastes the text at the end of the document.
If the shapes in the document don't have names like Text Box X, you could try removing the If and End If lines and see if it cuts/pastes the text from whatever the shapes are. Be aware that if you do that, it will also delete *all* the shapes (arrows, circles, lines, etc.) after trying to cut/paste the text from each one.
Sub RemoveTxt()
For Each Shp In ActiveDocument.Shapes
If Shp.Name Like "*Text*" Then
Shp.TextFrame.TextRange.Cut
Shp.Delete
Set DocRange = ActiveDocument.Range
DocRange.Collapse Direction:=wdCollapseEnd
DocRange.Paste
End If
Next
End Sub

![]() |
MS Word error message
|
Outlook Express won't rec...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |