Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. 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

by Allen Wyatt
(last updated November 1, 2018)


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 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. Understand, as well, that anything "special" in the text—such as tables—is converted to regular text by the macro. This means that the macro may result in a fair amount of work that needs to be done in formatted the transferred text.


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, and 2013. 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. ...


Printing Field Codes

Field codes allow dynamic information to be included in documents and can be a great boon. At some point you may want to ...

Discover More

Pulling Headers and Footers from Other Files

You may have some standard headers and footers you want to make available in your document templates. This tip describes ...

Discover More

Restoring a Deleted File

Delete a file in Drive and it is moved to the Trash folder. You can recover files previously deleted so they can be used ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Selecting Text in Linked Text Boxes

Text boxes are often used as design elements in a document layout. If you have linked text boxes, you may have noticed ...

Discover More

Adding Sidebars

When designing your document, you may want to use sidebars like you see in magazines and some books. This tip explains ...

Discover More

Creating See-Through Text Boxes

When laying out your document, you may want to use a text box that appears to be positioned over your text, but to be ...

Discover More

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

View most recent newsletter.


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}] 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 + 7?

2019-06-06 16:33:41


A quick method I just found that keeps most of the formatting is to copy the document to Wordpad and then copy the document back into Word without using special paste options.

2019-04-09 03:18:57


It was asked below why text extraction from textboxes could be required.

It is required if you want to do something with the text, say, just to store that, or to translate to other language...

The easiest way of extracting text from all textboxes in a go is to copy all text boxes, and paste them in WORDPAD. That will remove textboxes and the text will appear in separate lines.

before pasting to wordpad, do UNGROUP any grouping in ms word and then copy from ms word, otherwise grouped text is pasted as an image in wordpad.


2019-04-08 17:15:18


Normally, several text boxes are grouped to put texts at select location.

RemoveTextBox2() doesn't work on grouped text boxes. Once I manually selected them and rightclick-Ungroup, then onward it worked.

Please update the macro to put vba version of "ungroup" at some place before extracting text.


2019-04-08 17:14:14


I think that "Textbox start << " & sString & " >> Textbox end" was a bad idea.

it would be more convenient if each textbox text is extracted in a new paragrph.

so, changing that to vbcr & sString & vbcr will do that and that is a neat and clean output.


2018-09-07 03:43:29


Some possibilities:

1. You are not in Word for PC
2. The cursor was in the header (or footer) when you pressed CTRL + A and the vertical blue area to the right is an empty rectangle anchored to the header (or footer).
3. The vertical blue area is a rectangle filled with blue and you haven’t clicked CTRL + A, otherwise the text would have been selected as well.

2018-09-06 11:18:00


From Ken
CTRL + A only selects whatever story that the cursor is in. Your text boxes are probably in a header or footer.

I have tried the remove text box macro and it changes the layout of the text boxes but, still can only select text boxes one at a time manually. When i do this i can tell that they are in the body or the header but still can select all.

All that is highlighted is some blank text in the background. (see Figure 1 below)

Any ideas.

Figure 1. Only selecting blank text with CTL+A

2018-09-06 02:36:14


CTRL + A only selects whatever story that the cursor is in. Your text boxes are probably in a header or footer.

2018-09-05 12:58:07


doesnt work because the text boxes are not selected when i press ctl+a

2016-11-22 14:14:21

Karen Warseck

This is WONDERFUL!!!!!!!!!!!!

Now if you can only make it retain the formatting, I will be in heaven.

2016-01-27 11:57:25

Ken Endacott

Why are you against textboxes?
They can be very useful.

2016-01-25 08:42:59

Robert S. Rawding

Whose idea, in God's name, was it to "invent" text boxes anyway. This is some kind of archaic holdover from keypunch days I guess. VERY STUPID.


2015-10-21 22:04:46


At first, the VBA did not work for me. I'm using Word 2010.

Eventually realized that the problem was that my .docx file was in Word 2007 format (compatibility mode). Once I converted it to Word 2010 format, the VBA worked!

2015-09-03 10:10:42


Worked perfectly for me in Word 2010, Ken. Thank you.

2015-06-26 09:24:58


yes, but still getting error in following line
Selection.TypeText(txt) - reference to a non-shared member required an object refernce


For Each shp As Microsoft.Office.Interop.Word.Shape In Document.Shapes - variable shp hides a variable in an enclosing block

2015-06-25 09:10:25

Ken Endacott


Are you using VBA. You seem to be using VB.

2015-06-25 03:28:04


Hi Ken Endacott,

i am sorry for so many queries, i am new to this. Please share c# code of the below macro. i am getting lots of errors like
1 - msoTextBox- does not exist in current context

2-Shape shp = default(Shape);
foreach (shp in document.Shapes) - The type or namespace "shp" cannot be found

3 - Selection.TypeText txt; - C# equvivalent code for this line.
Please guide me. :(


2015-06-25 02:17:06


Hi, thankyou soo much for you answer.
i getting an error on following line

1 - foreach ( shp in ActiveDocument.Shapes) - (error msg-ActiveDocument does not exist in current context)

I have added reference of following
using Microsoft.Office.Interop;
using Microsoft.Office.Tools.Word;
using Microsoft.Office.Interop.Word;

if possible please share C# code of the same. If C# is not possible then please atleast give me a solution of ActiveDocument.


2015-06-24 05:41:49

Ken Endacott

The following macro will remove textboxes and put their content at what was the anchor point of the textbox. As it stands it works only on textboxes and not on shapes containing text frames.

Sub RemoveBoxFromText()
Dim shp As Shape
Dim txt As String
For Each shp In ActiveDocument.Shapes
If shp.Type = msoTextBox Then
txt = shp.TextFrame.TextRange.Text
Selection.TypeText txt
End If
Next shp
End Sub

2015-06-24 04:16:55


i want to delete shapes and replace the content on the shape at the same postion as it is. For example - in a doc file , i have a textbox with some content. I just want to remove the textbox and want to put/insert content of textbox on the same position where the textbox was.
Hope u understood my question. Please guide me for the same.

2015-05-21 19:37:23

David Lackowski

It seem like a lot of work to accomplish something that should be done much more simply. Not worth the bother!

2015-05-11 01:55:30

Dianne DeSha

Thanks, Ken! Finally worked for me! :)

2015-04-28 09:04:07

Ken Endacott

The macros have problems.

The first problem is that the macros will not delete all the textboxes in one pass because as a shape is deleted the number left decreases and ActiveDocument.Shapes.Count changes. The solution is to delete in reverse order.

The second problem is that only textboxes in the document body are deleted. There can also be textboxes in other story parts such as headers and footers.

The third problem is that text can appear in shapes other than textboxes. If the shape is a rectangle then it looks like a textbox but isn’t.

The macro below is a replacement for RemoveTextBox1. It will delete all textboxes and their contents wherever they are and delete the text only from other shapes that contain text.

Sub RemoveTextBox1()
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
Set oTxtFrame = shp.TextFrame
If oTxtFrame Is Nothing Then
' shape does not have a text frame
If oTxtFrame.HasText Then
oTxtFrame.TextRange.Text = "" ' deletes the text but not the shape
' shp.Delete will delete the shape including its text
End If
End If
End If
Next k
Next stry
End Sub

2015-04-27 18:07:43

Bob Fast

For god's sake how do you just delete an unwanted box in word??? Wthout macros, without losing formatting... just get rid of it!

2015-04-10 11:35:38


If you want to remove all shapes from a document, you can use this macro:

Sub RemoveAllShapes()
End Sub

The For-Each loop in the article did not work for me, but this does.

2015-02-17 11:15:02


The remove formatting option worked for me using Word 2010. Thank you.

2015-01-24 00:12:04

Rajiv Kamal

Usless stuff.

Fr name sake it removes the text box. property of the text inside text box still remains the same.

i.e. after running the macro successfully, the text behaves in the same manner.

2015-01-16 18:29:19


The Paste Special, Unformatted Text option doesn't work. I have Word 2010. Just gives me two blank pages.

2014-11-12 10:07:00


This macro didn't work for me, either. It just blew the formatting all over the place and left the text in text boxes. Using Word 2013.

2014-10-25 15:28:09


tried 3 times, it only increased the background formatting

2014-03-16 19:46:15


Worked for me using word 2010.

Unfortunately the anchor point is the top of the page.

Is it possible to set the insertion point of the range object using 'shp.Left' and 'shp.Top' to get the text in the something like the right place?

2013-12-24 15:38:44


This tip did not work for me. I have Word 2007. I tried the macro to remove all textboxes but leave the text.

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.

Newest Tips

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.