Removing Text Boxes but Saving the Text

Written by Allen Wyatt (last updated August 29, 2020)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


1

Angela has a document that has about 400 text boxes in it, and each text box contains text. She wonders if there is a way of removing the text boxes but leaving the text in the document.

This can be done manually by simply selecting the text in a textbox (being sure not to select the textbox itself), pressing Ctrl+C to copy the text, clicking where you want the text to go, pressing Ctrl+V, and then deleting the text box. This would, however, quickly get tedious when you are dealing with as many text boxes as Angela has.

In this case, it is best to rely on a macro to do the changes. The macro can run through all the text boxes rather quickly, doing the work that is necessary. The following is an example of such a macro:

Sub ConvertTextboxText()
    Dim shp As Shape
    Dim oRngAnchor As Range
    Dim sTemp As String
    Dim J As Long

    For J = ActiveDocument.Shapes.Count To 1 Step -1
        Set shp = ActiveDocument.Shapes(J)
        If shp.Type = msoTextBox Then
            sTemp = shp.TextFrame.TextRange.Text
            If Len(sTemp) > 1 Then
                Set oRngAnchor = shp.Anchor.Paragraphs(1).Range
                sTemp = Left(sTemp, Len(sTemp) - 1)
                oRngAnchor.InsertBefore "[[ " & sTemp & " ]]"
            End If
            shp.Delete
        End If
    Next J
End Sub

This macro works only with text boxes, ignoring any other shapes that may contain text. It starts at the last text box and works its way toward the beginning of the document. When done, all the text that used to be inside of the text boxes is inserted at the beginning of the paragraph to which the deleted text box was previously anchored.

In addition, that text is surrounded by [[ double brackets ]] so you can easily tell where the text is located. Since text boxes can sometimes be anchored a ways away from where they appear in the document, you will definitely want to search for these double-bracketed pieces of text and move them to where you want them finally located.

If you are looking for other ways to accomplish the same task, you might be interested in this web page:

https://www.datanumen.com/blogs/2-quick-methods-extract-texts-text-boxes-word-document/

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (7739) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Making Sure Word Doesn't Capitalize Anything Automatically

Word, in an effort to be helpful, will often change the capitalization of the words you type. If you tire of Word's ...

Discover More

Changing Body Text to a Heading

When working on a document in Outline view, you may need to change regular body text to a heading in the outline. It's ...

Discover More

Copying and Pasting Field Codes

Want to copy a field code and paste it in some other Windows program? This can be trickier than it sounds. Here's the ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Inserting a Text Box

Many people use text boxes to help organize and layout information on the page. Here's how you can add text boxes to your ...

Discover More

Columns in a Text Box

Want to divide a text box into columns? Word doesn't allow you to do this, but there are ways to work around the limitation.

Discover More

Removing the Box from a Text Box

Insert a text box and it is automatically formatted to have a border around it. Getting rid of the border is easy if you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 1?

2020-08-29 19:37:29

Patty

Great tip! I don't need it now, but I could see its utility if I every get a ms. filled with boxes. Thanks, Allen!


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.