Word.Tips.Net WordTips (Menu Interface)

Removing All Text Boxes In a Document

Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Removing All Text Boxes In a Document.

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. Choose Paste Special from the Edit menu. Word displays the Paste Special dialog box. (See Figure 1.)
  5. Figure 1. The Paste Special dialog box.

  6. In the list of formats, choose Unformatted Text.
  7. 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 RemoveTextBox1()
    Dim shp As Shape
    For Each shp In ActiveDocument.Shapes
        If shp.Type = msoTextBox Then shp.Delete
    Next shp
End Sub

You should realize that this macro removes all of the text boxes and their contents. 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 a slight modification on the above macro will work:

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

    For Each shp In ActiveDocument.Shapes
        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)
            If Len(sString) > 0 Then
                ' set the range to insert the text
                Set oRngAnchor = shp.Anchor.Paragraphs(1).Range
                ' insert the textbox text before the range object
                oRngAnchor.InsertBefore _
                  "Textbox start << " & sString & " >> Textbox end"
            End If
        End If
    Next shp
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.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1690) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Removing All Text Boxes In a Document.

Related Tips:

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!


Comments for this tip:

Ank60    30 Jun 2015, 04:25
Thank you!! You save my time!
vanda    24 Jun 2015, 07:30
sorry to come with same issue. I have tried the same in Vb.net i am getting following error.

'ActiveDocument' is not declared. It may be inaccessible due to its protection level.
i have given reference of following -

Imports Microsoft.Office.Interop
Imports Microsoft.Office.Tools.Word
Imports Microsoft.Office.Interop.Word

Please tell me what is wrong here.
vanda    24 Jun 2015, 07:18
I tried delete textbox function

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

but i am getting an error "ActiveDocument does not exist in current context" i have given reference of following -
using Microsoft.Office.Tools.Word;
using Microsoft.Office.Interop.Word;

Please tell me wats wrong i am not able to understand(i have converted above code to C# as my application is in c#)

FOLA    26 Jan 2015, 13:05
Perfect.....Thanks alot Allen
HMT    01 Oct 2014, 15:10
It worked!
Thank you soooo much for this.
jyoti    22 Sep 2014, 04:55
thanks to you, for step
Paula    21 Nov 2013, 14:30
Just wanted to thank you. It was so clear and simple. Thanks!
Hamad Subani    03 Jun 2013, 17:19
Thank you so much! I would not be able to locate a text box in a 200 page document were it not for this little macro.
Duong Ngo    25 Mar 2013, 18:52
Work for me, over 200 text boxes in 155 pages were disappeared in 1, sorry I meant in 2 clicks. BIG thank for the tip! In MS Word 2007 or later, just click on the arrow of Paste button, which is on the top left of the Word window, a mini menu drop down and "paste special" is in second row. GL!
awyatt    27 Oct 2011, 08:56
Nhu Cam,

You'll notice, not far above these comments, that there is an indication this tip is only for versions of Word up through Word 2003. If you are using Word 2007, then you should click the link to see the version of this tip for that version.
nhu cam    27 Oct 2011, 05:45
I can't find a paste special in Edit menu in word 2007. Help me!!

Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 4+5 (To prevent automated submissions and spam.)
          Commenting Terms

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2013)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2013)

Our Products

Premium Newsletters

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2015 Sharon Parq Associates, Inc.