Software

Create a shortcut to paste unformatted text into a Word document


This information is based on a TechRepublic PDF download and photo gallery.

All kinds of situations call for pasting text into a document without bringing the formatting with it -- like when you copy something from a Web site and don't want to insert a bunch of table cells and oddball font sizes. One way to leave formatting behind is to use Word's Show Paste Options feature, which offers the Match Destination Formatting command. Unfortunately, the feature is a little cumbersome to use, and earlier versions of Word don't include it.

The Paste Special command offers another choice, but it's not terribly efficient either. Users have traditionally appreciated this alternative: a one-line macro that automatically pastes text without formatting, along with a button or keyboard shortcut that makes the process instantaneous.

  1. Choose Tools | Macro | Macros. Type a name (e.g., NoFormatPaste) in the Macro Name text box and click Create to open the VB editor. Enter Selection.PasteSpecial DataType:=wdPasteText, as shown in Figure A, and choose File | Close And Return To Microsoft Word.

Figure A

  1. To create a shortcut to run the macro, choose Tools | Customize, click the Commands tab, and click Keyboards. Choose Macros from the bottom of the Categories list and select the macro from the Commands list box. Enter the desired combo in the Press New Shortcut Key text box, as shown in Figure B. (Check the Currently Assigned To field to make sure the shortcut's not already in use.) Click Close twice.

Figure B

  1. To create a button to run the macro, choose Tools | Customize and click the Commands tab. Choose Macros from the Categories list, select the macro from the Commands list, and drag it to the toolbar where you want the button to appear (Figure C).

Figure C

  1. To shorten the name, right-click on the macro to display a shortcut menu. You can then edit the name in the Name text box. Click Close in the Customize dialog box. Your toolbar will now include the new button, as shown in Figure D.

Figure D

Word 2007

In Word 2007, the process is similar -- but different enough to warrant its own instructions:

  1. Click the Developer tab on the Ribbon. (If you don't have a Developer tab, you'll need to choose Word Options from the Office menu and select the Show Developer Tab In The Ribbon option.)
  2. Click the Macros button in the Code group (left end of the Ribbon), and Word will open the familiar Macros dialog box. You can proceed as described above to create the macro.
  3. To create the keyboard shortcut, choose Word Options from the Office menu and click Customize in the left pane. Click the Customize button at the bottom of the screen to open the Customize Keyboard dialog box. As with earlier versions, choose Macros from the Categories list, select your macro from the Commands list box, type your shortcut in the Press New Shortcut Key text box, and then click Assign and Close.
  4. To create a button to run the macro, choose Word Options from the Office menu and click Customize in the left pane. Select Macros from the Choose Commands From drop-down list. Then, select NoFormatPaste from the list of macros and click Add. Word will add the macro to the list box on the right, as shown in Figure E.
  5. Click Modify to open the Modify Button dialog box, where you can select an icon if you want and edit the text in the Display Name text box. When you finish, click OK to add the button to your Quick Access Toolbar, as we've done in Figure F.

Figure E

Figure F

About

Jody Gilbert has been writing and editing technical articles for the past 25 years. She was part of the team that launched TechRepublic and is now senior editor for Tech Pro Research.

9 comments
EnigmaV8
EnigmaV8

That's an awful lot of work when you could just use Ctrl+Alt+V. I apologize in advance for any bubbles burst. ;-)

pcbube
pcbube

Very helpful. Thanks!

james_bosworth
james_bosworth

Very useful - note that the equivalent VBA in Powerpoint that works for me is: ActiveWindow.Selection.TextRange.PasteSpecial DataType:=ppPasteText You don't seem to be able to add it as a keyboard shortcut, but you can add it as a toolbar button.

eman6101
eman6101

Doesn't work for me. I get "Selection.PasteSpecial DataType:=wdPasteText" pasted into my document when I try to run your macro. What am I doing wrong?

jeb500
jeb500

Great tip! (nice blog too). You can also redefine your ctrl-V key so that it always pastes unformatted, which is what I have done.

djp81s8
djp81s8

When you paste something into word a little clipboard appears it gives you options to keep the formating or not.

Bendon
Bendon

I tried your VBA code and it didn't work. I'm using PPT 2003, if that makes a difference. I know very little about Macro's, but this seemed like a good time to learn. I first created a module in the VBA editor which looked like this Sub NoFormatPaste() ActiveWindow.Selection.TextRange.PasteSpecial DataType:=ppPasteTextSelection.PasteSpecial DataType:=ppPasteText End Sub I saved it. And then I copied the individual line of text from an excel document. In ppt, I clicked my newly made button (without keyboard shortcut) and nothing happened. No bug found. Simply nothing happened. Any idea what's going on here?

eman6101
eman6101

Duh, Of course it psated that, I had just selected it.

Editor's Picks