Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Removing All Text Boxes In a Document.

Removing All Text Boxes In a Document

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


If you do a lot of work with documents from other people, you may have a need to remove text boxes in those documents. If there are only one or two text boxes in the document, it is not that difficult to select them and delete them. What if there are 30, 40, or more text boxes, though? Deleting them individually can quickly get tedious.

One potential solution is a "brute force" method. Follow these steps:

  1. In your document, press Ctrl+A. The entire document is selected.
  2. Press Ctrl+C. The document is now on the Clipboard.
  3. Open a new, blank document.
  4. Make sure the Home tab of the ribbon is displayed.
  5. Click the down-arrow under the Paste tool (at the left side of the ribbon) and choose Paste Special. Word displays the Paste Special dialog box. (See Figure 1.)
  6. Figure 1. The Paste Special dialog box.

  7. In the list of formats, choose Unformatted Text.
  8. Click on OK.

The document text, minus the text boxes, is now in the new document. The obvious drawback to this approach is that the other formatting of the original document is also lost, and you must reformat the entire document. (I told you this was a brute force method.)

If you want to get rid of only the text boxes, then the quickest solution is to use a macro. The following macro will quickly remove all text boxes in your document:

Sub RemoveTextBox()
    Dim shp As Shape
    Dim stry As Range
    Dim oTxtFrame As TextFrame
    Dim j As Long
    Dim k As Long

    For Each stry In ActiveDocument.StoryRanges
        j = stry.ShapeRange.Count
        For k = j To 1 Step -1
            Set shp = stry.ShapeRange(k)
            If shp.Type = msoTextBox Then
                shp.Delete
            Else
                Set oTxtFrame = shp.TextFrame
                If oTxtFrame Is Nothing Then
                    ' shape does not have a text frame
                Else
                    If oTxtFrame.HasText Then shp.Delete
                End If
            End If
        Next k
    Next stry
End Sub

You should realize that this macro removes all of the text boxes and their contents, along with any other shapes that contain text. In other words, if a text box is used for placement of text, then the text in that text box is deleted along with the text box itself.

If you prefer to transfer the text from the text boxes to the document, prior to deleting the text box, then the following macro should do the trick:

Sub RemoveTextBox2()
    Dim shp As Shape
    Dim oRngAnchor As Range
    Dim sString As String
    Dim stry As Range

    For Each stry In ActiveDocument.StoryRanges
        For Each shp In stry.ShapeRange
            If shp.Type = msoTextBox Then
                ' copy text to string, without last paragraph mark
                sString = Left(shp.TextFrame.TextRange.Text, _
                  shp.TextFrame.TextRange.Characters.Count - 1)
                sString = Trim(sString)
                If Len(sString) > 0 Then
                    ' set the range to insert the text
                    Set oRngAnchor = shp.Anchor.Paragraphs(1).Range
                    ' insert the text before the range object
                    oRngAnchor.InsertBefore _
                      "Textbox start << " & sString & " >> Textbox end"
                End If
                shp.Delete
            End If
        Next shp
    Next stry
End Sub

When this macro is done, you can do a search for "Textbox start" and you will be at the beginning of text that used to be in the text boxes that are now gone from your document. You can then edit the text so that it appears as you want. Understand, as well, that anything "special" in the text—such as tables—is converted to regular text by the macro. Also, the text is inserted where the text box was anchored, which may be at a different point on the page than where the text box appeared before it was deleted. All of this means that the macro may result in a fair amount of work that needs to be done in formatted the transferred text.

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 (9169) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Removing All Text Boxes In a Document.

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

Wrapping Spaces

Add more than one space after the end of a sentence, and you may find that the extra spaces wrap to the start of new ...

Discover More

Limiting Scroll Area

If you need to limit the cells that are accessible by the user of a worksheet, VBA can come to the rescue. This doesn't ...

Discover More

Repeating Table Captions with Modifications

Captions can be a great addition to items in your document such as figures and tables. If you want modifications in those ...

Discover More

Discover the Power of Microsoft Office This beginner-friendly guide reveals the expert tips and strategies you need to skyrocket your productivity and use Office 365 like a pro. Mastering software like Word, Excel, and PowerPoint is essential to be more efficient and advance your career. Simple lessons guide you through every step, providing the knowledge you need to get started. Check out Microsoft Office 365 For Beginners today!

More WordTips (ribbon)

Finding an Invisible Text Box

Text boxes can be a great aid in designing the layout of your document. What do you do when you can't find a text box ...

Discover More

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

Rounded Corners for a Text Box

Text boxes are great for positioning information the way you want it to appear in your page layout. Fortunately, 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 two minus 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.