Pasting as unformatted text in Word
Posted on March 18, 2007 • 1 min read • 166 wordsI really got annoyed when copying text from an HTML page to Word. I really use a lot of cut ‘n paste from the keyboard in Word. Pasting unformatted text…
I really got annoyed when copying text from an HTML page to Word. I really use a lot of cut ‘n paste from the keyboard in Word.
Pasting unformatted text is possible in Word, but you have to go through the menus. As a keyboard jockey I don’t like that.
In the hope to replace the “paste” to a “paste unformatted text” on the keyboard I recorded a macro and placed it under ctrl-v. At least the ctrl-v executed my macro, but the macro really didn’t do what it should. It pasted my text like always, but formatted.
After inspecting the macro I saw that the recording of the macro did something strange.. Although I chose paste as unformatted text it recorded the following:
Sub PasteText ()
Selection.PasteAndFormat(wdPasteDefault)
end sub - After doing some googling I changed the wdPasteDefault to wdFormatPlainText, so my macro now looks like below and works like a charm. No more mousing for me in Word :D
Sub PasteText ()
Selection.PasteAndFormat(wdFormatPlainText)
end sub