Paste text as plain text
Posted on December 24, 2017 • 1 min read • 195 words
I prefer to use the keyboard instead of the mouse, especially for actions like cutting and pasting. For cutting and pasting I actually only use keyboard combinations. I find it quite annoying when I paste text from an HTML page into a Word document. I then have to do something with my mouse, namely clear the formatting. As a keyboard jockey, I don’t really like that, especially when I have to struggle to come up with [writing]/how-to-get-writers-block-7-tips/.
In hopes of replacing “paste” with “paste unformatted text” on the keyboard, I included a macro for pasting text as unformatted text. I placed this macro under ctrl-v. So far so good you might say, but unfortunately the macro didn’t quite do what I wanted, or actually not at all. The macro pasted my text just like always, but neatly formatted.
After a close inspection of the macro I noticed something strange. Even though I had chosen to paste as plain text, the recording read:Sub PasteText () Selection.PasteAndFormat(wdPasteDefault) end subAfter some googling I found out that this can easily be solved by replacing wdPasteDefault with wdFormatPlainText. My macro now looks like this:```
Sub PasteText ()
Selection.PasteAndFormat(wdFormatPlainText)
end sub