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: Pasting Clean Text.

Pasting Clean Text

by Allen Wyatt
(last updated March 8, 2017)


I paste a lot of text. (I mean a LOT of text.) When I am copying and pasting text within the same document, it is no problem. When I am copying text from other places, however, pasting that text into a Word document can have strange effects. This isn't a Word problem; it is something about the text I am copying and pasting that causes funky appearance of the text.

To get around this, I normally choose Edit | Paste Special and make sure that the text I am about to paste will be added to the document as unformatted text. Of course, since I paste so much text, continually choosing Edit | Paste Special can be bothersome.

The solution, for me, was to create a very short macro that does the pasting I want—as unformatted text. The following macro, PasteClean, does just that:

Sub PasteClean()
    Selection.PasteSpecial Link:=False, _
      DataType:=wdPasteText, _
      Placement:= wdInLine, _
End Sub

To make this macro an even more valuable editing tool, I assigned it to a custom tool on the toolbar. Now, when I want to paste a clean copy of what text is in the Clipboard, I simply click the tool and the macro does the rest.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1310) 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: Pasting Clean Text.

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. ...


Errors while Printing

Printing a document is a common task in Word. What if you get an error message while printing? Tracking down the cause ...

Discover More

Rounding Up to the Next Half

When processing data it is not unusual to need to round that data in some way. For instance, you may need to round a ...

Discover More

Unwanted Cover Pages with Print Jobs

When you print a document, do you get more than you bargained for? If you get extra pages printed either before or within ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (menu)

Adding Quotes

Adding quote marks is normally as simple as typing them from the keyboard. However, if you want to add quote marks around ...

Discover More

Removing Entire Paragraphs from Your Document

If you need to get rid of a lot of paragraphs in a document, it's easy to do as long as the document relies on styles for ...

Discover More

Turning Off Word's Second Guessing with Quote Marks

When you type quote marks in a document, Word normally changes them to Smart Quotes. They look better on a printout, but ...

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 four less than 8?

2016-03-09 17:23:36

Richard Ong

Thank you so much, Ned. That new command works like a charm. I recorded a new macro and it came up with:

Selection.PasteAndFormat (wdPasteDefault)

and that wasn't working.

I don't allow automatic updates and recently installed a big backlog of updates. My troubles may have begun then for the reason you suggest.

You've saved me from one of life's persistent niggling irritations!

2016-03-08 09:30:47

Ned Zimmerman

like you I had a macro that used
Selection.PasteSpecial DataType:=wdPasteText

for years without issue.

The commenter in the thread you linked to missed the point. The issue isn't that the Clipboard is empty, it's that it contains something that isn't text.

I believe a recent MS security update for Word has changed the PasteSpecial behavior in Word 2007 so that it now throws the runtime error 5342 if the data type of the clipboard contents is not text.
Previously it would just attempt to grab whatever text was in the Clipboard contents and paste that only. My guess is that someone figured out a way to abuse this behavior.

If you record a new macro to paste text unformatted you will now see the following:

Selection.PasteAndFormat wdFormatPlainText

This does what you want without throwing the runtime error.

We all just need to update our macros.

2016-02-27 13:15:48

Richard Ong


A commenter at this site

suggests that that error message is because nothing was copied into the clipboard. The commenter suggested adding this code before the Selection.PasteSpecial command:

On Error Resume Next

This leads to no error message (5342) being displayed when the the macro is run but there is, in fact, text on the clipboard as ctrl-v or Edit->Paste special->Unformatted text both copy something, the first with formatting, the second without.

2016-02-27 12:48:18

Richard Ong

In Word 2003, I have achieved this "paste unformatted" feat in the past by recording a macro consisting of my going through the menu thus: Edit->Paste special->Unformatted text.

This yields a macro with this code:

Selection.PasteSpecial DataType:=wdPasteText

This has worked fine for months and months but for some reason it started pasting text WITH formatting. I don't remember doing anything to my settings. I ran "Detect and repair" under Help but that didn't help.

I found your entry here but your suggested code pastes nothing and I get the error window with this message:

"Run-time error '5342':

The specified data type is unavailable."

Ctrl-v pastes SOMETHING but it's formatted, of course.

2015-06-14 14:04:27

Charles Morford

This may be another of your tips that I can really use. I am writing a book in Word 2003. The 10 chapters of text are complete. I used a pre-formatted template provided by the publisher (CreateSpace). Now I have to complete my work to PDF to submit it to them. I would like to have as clean a copy as possible without loosing the necessary formatting. Will this tip work for me or do you have a better idea? Thank you in advance for your help.

2013-05-01 08:33:08

arnold ziffel

Great tip, got something along those lines that I need a macro for. 1)I have a word document that spans a full 80 char wide (only left 50 char used) and thus won't print the first 4 left char. 2) I need to change font type and size. 3) there are a lot of tables and paragragh formatting that I need to get get rid of but keep the text location . I have over 1500+ rtf type documents that I need to "convert" at one shot into a document that has the proper left printable margin. Can you help

2012-08-21 01:11:10

Shanker. K.Vee.

Hey Allen,

What about 'Cut, Copy, and Paste' options under 'Advanced' in 'Word Options'? Having a macro instead is anyway better?

This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon 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.