• On mySimon: Activision DJ Hero Bundle with Turntable
December 18, 2007 12:01 AM PST

Create a keyboard shortcut to paste plain text

by Dennis O'Reilly

Last week I described the PureText utility that lets you paste plain text in Word and other applications via a keyboard shortcut. You can create a macro to get the same functionality in Word and Excel, without having to download anything.

(Note that the original post of this tip reported that PureText required that you click its icon in your system tray before you press the shortcut keys to paste plain text. This is true only if you open the destination app after the material you want to paste has been added to the clipboard. If both the source and destination programs are open when you initially copy the text, you need only press PureText's shortcut key to paste the text without images, formatting, and other non-text elements. my thanks to the reader below for pointing out this error.)

Paste plain text in Word via the keyboard
In Word 2003, click Tools*Macro*Macros. In Word 2007, click View*Macros. In both versions, type PlainPaste in the Macro name field (you can name it anything you like, but the name must begin with a letter, have no spaces, and use no punctuation), and choose Create. Place the cursor at the beginning of the line just above "End Sub" and type Selection.PasteSpecial DataType:=wdPasteText. The only space in the line is between "PasteSpecial" and "Datatype:". Press Ctrl-s to save the macro, and click File*Close and Return to Microsoft Word.

The Microsoft Visual Basic Editor screen for creating a new macro.

Type this text in the penultimate line of your macro to paste plain text.

Now test the macro: Select a mix of text and other elements in your browser or some other application, press Ctrl-c to place it on the clipboard, return to Word, click Tools*Macro*Macros in Word 2003, or View*Macros in Word 2007, select PlainPaste in the list of Macros, and click Run. Only the text should appear, in the format of the document, not of the source.

Next, assign a keyboard shortcut to the macro: In Word 2003, click Tools*Customize*Commands, make sure Normal.dot is selected in the "Save in" drop-down menu, and click the Keyboard button. Scroll down the Categories list in the top left and select Macros. Choose PlainPaste (or whatever you named the macro) in the right pane, click in the "Press new shortcut key" box, type Ctrl-t (or the unused key combination of your choice, beginning with Ctrl, Alt, and/or Shift), select Assign and then Close twice.

To assign the keyboard shortcut in Word 2007, click the Office button in the top-left corner, choose Word Options at the bottom of the window, click Customize in the left pane, and then the Customize button to the right of "Keyboard shortcuts" at the bottom of the Word Options dialog box. Scroll to and select Macros in the Categories window, select the PlainPaste macro in the window to the right, click in the "Create new keyboard shortcut" field, type Ctrl-t (or your choice of combination, beginning with Ctrl, Alt, and/or Shift), click Assign, then Close, and finally OK.

The Customize Keyboard options screen in Microsoft Word.

Set a keyboard shortcut for your plain-paste macro in Word.

Give Excel a plain-paste keyboard shortcut
Here's the fastest way I know of to create a plain-paste keyboard shortcut in Microsoft Excel: First, select any text and press Ctrl-c to place it in the clipboard. In Excel 2003, click Tools*Macro*Record New Macro. In Excel 2007, click View*Macros*Record Macro. Enter a name in the "Macro name" field, beginning with a character, and without any spaces or punctuation. Click in the "Shortcut key" box, type t (or the letter of your choice, as long as it isn't already assigned to a shortcut that begins with Ctrl), and press OK. In Excel 2003, click Edit*Paste Special*Text*OK, and press the Stop Recording button on the tiny toolbar that popped up when you closed the Record Macro dialog box. In Excel 2007, click Home*Paste*Paste Special*Text*OK*View*Stop Recording.

When you close Excel, you'll be asked if you want to save the changes in the Personal Macro Workbook. Click Yes to make the shortcut available when you reopen the application.

Tomorrow: The (selective) return of smart quotes in Microsoft Word.

Dennis O'Reilly has covered PCs and other technologies in print and online since 1985. Along with more than a decade as editor for Ziff-Davis's Computer Select, Dennis edited PC World's award-winning Here's How section for more than seven years. He is a member of the CNET blog Network, and is not an employee of CNET.
Recent posts from Workers' Edge
Troubleshoot Windows 7 upgrade woes
Browse safely by blocking Web ads
Free alternatives to Adobe Reader
Finding the catch in 'free' software
Remove files attached to messages in Outlook, Thunderbird, and Yahoo Mail
Beat the flu by working remotely
Free disk-imaging utility avoids Windows reinstalls
RoboForm Online secures personal data in 'cloud'
Add a Comment (Log in or register) (11 Comments)
  • prev
  • 1
  • next
by dsk_nj December 18, 2007 4:58 AM PST
You apparently missed the point entirely. You don't need to click anything to paste unformatted text. Just use the hot key. Frankly, if I had to click somewhere to paste plain text, the value of the utility would be reduced to the point of a "so what". The documentation might have been a little clearer, I suspect, but if you are clicking on the tray icon you're working WAY too hard.
Reply to this comment
by doreilly December 18, 2007 2:09 PM PST
I'm using the latest version of PureText, and the only way I can get the plain-paste shortcut to work is by placing the text in the clipboard by pressing Ctrl-c, then clicking the "PT" icon in the system tray, and finally pressing the Windows key and v. If I don't click the system-tray icon, nothing pastes. What am I missing?
by doreilly December 18, 2007 2:26 PM PST
Upon further review, it appears that to paste plain text without having to click the PureText icon, the application into which you're pasting has to be open before the content is placed into the clipboard. I was copying the material from a Web page, and then opening the program I wanted to paste it into. When both the destination app is open when the material is placed into the clipboard, the Windows key-v combination pastes the plain text without having to click the PureText icon. (At least the macro approach saves you a download.) Thank you for pointing out the error.
by Jack K1 December 18, 2007 7:29 AM PST
It's not a wise idea to save macros in Normal.dot (though it is easiest, and it is the default). Too many organizations choose to use Normal.dot for their own purposes (they shouldn't but they do). As a result, any time the organization decides to update this template, the user will lose his or her macros and have to start all over again. Naturally, this can be very frustrating. Users should instead create their own template in which to store their personal macros.
Reply to this comment
by doreilly December 18, 2007 2:12 PM PST
Won't people who create and use their own template for the plain-paste macro lose access to their organization's custom macros in the Normal.dot template? Or is there a way to merge the two templates in some way?
by Wookiee-1138 December 18, 2007 3:49 PM PST
Would this work in OpenOffice?
Reply to this comment
by firefly-18 December 18, 2007 3:54 PM PST
Thanks for this handy little trick. I have Office 2002 but the steps were still very similar. I shall be using this quite a bit I'd imagine
Reply to this comment
by WDS2 December 19, 2007 10:19 AM PST
I wish there was a way to make pasting plain text the default for any ^v paste. 99.44% of the time that's all I want to do.
Reply to this comment
by timada42 July 16, 2008 4:40 AM PDT
Should this work with office 2007 too? I would like to try this. It looks like a good tip that will make my daily work lot easier! Thank you for it! Thumb?s up!
_______________________________________________
Ada - Technology Transfer opportunties
Reply to this comment
by haywardz February 11, 2009 2:07 PM PST
Thank you so much for this tip. Extremely helpful to me! It worked great.
Reply to this comment
by grayforge September 1, 2009 12:10 PM PDT
Late post, but awesome trick and extremely clear instructions.

How about a more universal plainPaste? IE, one that works in Outlook as well?

Thanks!
Reply to this comment
(11 Comments)
  • prev
  • 1
  • next
advertisement

After 5 years, Firefox faces new challenges

Mozilla helped reshape the Web since releasing Firefox 1.0 five years ago. Now it's got a reawakened Microsoft and Google Chrome to reckon with.

There's a map for that: GPS or smartphone?

Almost every handset comes with mapping software these days, but standalone GPS devices are becoming more affordable than ever.

advertisement

About Workers' Edge

Dennis O'Reilly has covered PCs and other technologies in print and online since 1985. Along with more than a decade as editor for Ziff-Davis's Computer Select, Dennis edited PC World's award-winning Here's How section for more than seven years. He is a member of the CNET Blog Network and is not an employee of CNET.

Add this feed to your online news reader

Workers' Edge topics

advertisement
advertisement

Inside CNET News

Scroll Left Scroll Right