Paste Unformatted Text into Word
Usually, when I want to copy and paste text into Word from a web page, I don't want the formatting. I just want the text and nothing else. In this entry I discuss various ways I have used to do just that.
Updates.
13/08/2009 9:59:07 AM. Corrected macro text thanks to the very helpful comment by Robert Kszan. Thank you Rob!
10/05/2010 3:46:58 PM. Added my preferred choice - using AutoHotkey!
Use Autohotkey Script
This is an amazing Windows scripting engine that is easy to write for and continually amazes me at the fantastic things it can do. First, install Autohotkey. Then create a plain text script file called utilities.ahk (or anything you want - as long as it has extension ahk) with the following contents.
; http://superuser.com/questions/7271/most-useful-autohotkey-scripts ; Paste as plain text ^+v:: ClipSaved := ClipboardAll ; Save the entire clipboard to a variable of your choice. clipboard = %clipboard% ; Convert any copied files, HTML, or other formatted text to plain text. ClipWait, 2 Send ^v Sleep, 1000 Clipboard := ClipSaved ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll). ClipSaved = ; Free the memory in case the clipboard was very large. return
Save it and double click it - that's enough for AutoHotkey to pick up the script and have it ready. You should now see the AutoHotkey icon in your system tray. Test it out: copy something from a web-page; paste it into Word to see it pasted with formatting; then use control+shift+v to see it pasted as plain text.
Such an amazing tool, this is my preferred method for doing this now. Forget the rest of my post. :)
If you are as hooked as I am, feel free to try out the other scripts in the Superuser - Most useful AutoHotkey scripts? forum posting I got this one from. I have filled my utilities.ahk with others from that page; and since I want these shortcuts always available, I have put a shortcut to the file in my Startup folder (e.g. C:\Documents and Settings\Robert Bram\Start Menu\Programs\Startup
.
Use a Text Editor
One way is to first paste the formatted text into a text editor which ignores the formatting (such as UltraEdit or NotePad) and then re-copy the plain text from the text editor, and paste it into Word.
Use a Firefox Add-On
Alternatively, if I am copying the formatted text from Firefox, I use the Copy Plain Text add-on. I select and right click the text I want and select "Copy as Plain Text". Then I can paste the copied plain text directly into Word.
Use Paste Special
If I have copied the text from another browser (or maybe another Word Document or PDF or something else that copies as formatted text), I can use Word 2007's "Paste Special" function.
Use the paste keyboard shortcut: CTRL+V. This pastes the formatted text, but the "Paste Special" icon appears (a little clipboard icon). Click on this icon and select "Keep Text Only".
Alternatively, access the "Paste Special" dialog through Word's menus.
- On the Ribbon's Home Tab, select Paste (select the word "Paste", not the clip-board icon) to bring up the Paste menu.
- Select "Paste Special".
- In the "Paste Special" dialog, select "As:" "Unformatted Text".
- Note there is a keyboard combination of ALT keys you can use to bring up the "Paste Special" dialog: ALT, H (Home tab), V (Paste), S (Paste Special).
Earlier version of Word (that don't have the supposedly super useful Ribbon) have the "Paste Special" dialog under Edit > Paste Special (ALT, E (Edit), S (Paste Special)).
Use a Macro
The Paste Special function is excruciatingly tedious for repeated uses. Luckily, we can make a macro for it and assign a keyboard shortcut to the macro.
Word 2007
- On the Ribbon's View tab, select Macros (select the word "Macros", not the icon) to bring up the Macros menu.
- Select "View Macros" to bring up the Macros dialog.
- Or just press Alt+F8 to bring up the Macros dialog!
- In "Macro name", enter
PasteUnformattedText
. - Click Create.
- This opens Microsoft Visual Basic and creates a new
Sub
(Sub Procedure), calledPasteUnformattedText
. Make sure the Sub Procedure is in Normal > Modules > General. Type the following line into the Sub Procedure.Selection.PasteSpecial DataType:=wdPasteText
- The code window should look something like this:
(Click to open larger image.) - Save your work and close Microsoft Visual Basic (ALT+Q).
- Back in Word, select Microsoft Office button in the upper left-hand corner.
- Select "Word Options".
- Select Customize on the left hand side.
- Click the Customize button down at the bottom of the "Word Options" dialog to bring up the "Customize Keyboard" dialog.
(Click to open larger image.) - In the "Customize Keyboard" dialog, select Macros on the left hand side.
- Select the macro you just made (
PasteUnformattedText
) on the right hand side. - Click in "Press new shortcut key" and type the shortcut you want to use. I use "CTRL+SHIFT+V". It says this is currently assigned to something else, but I don't care - I override the old assignment because it isn't something I use.
- Click Assign and then Close to exit the "Customize Keyboard" dialog.
- Click OK to exit the "Word Options" dialog.
- You can now use that shortcut to access your macro.
Word 2003 and earlier
- Press Alt+F8 to bring up the Macros dialog.
- In "Macro name", enter
PasteUnformattedText
. - Click Create.
- This opens Microsoft Visual Basic and creates a new
Sub
(Sub Procedure), calledPasteUnformattedText
. Make sure the Sub Procedure is in Normal > Modules > General. Type the following line into the Sub Procedure.Selection.PasteSpecial DataType:=wdPasteText
- Save your work and close Microsoft Visual Basic (ALT+Q).
- Back in Word, select Tools > Customize to bring up the Customize dialog.
- Select the Commands tab.
- On the left hand side, select Macros.
- On the right hand side, select
Normal.NewMacros.PasteUnformattedText
(the macro you just created). - Click the Keyboard button down at the bottom of the "Customize" dialog to bring up the "Customize Keyboard" dialog.
- Click in "Press new shortcut key" and type the shortcut you want to use. I use "CTRL+SHIFT+V". It says this is currently assigned to something else, but I don't care - I override the old assignment because it isn't something I use.
- Click Assign and then Close to exit the "Customize Keyboard" dialog.
- Click OK to exit the "Word Options" dialog.
- You can now use that shortcut to access your macro.
Other Links
Other pages that helped me make this entry.
- Firefox's Copy Plain Text add-on.
- LifeHacker's article Create A Hotkey To Paste Plain Text In Microsoft Word.
- Meryl's Notes Blog article: Paste Special in Microsoft Word