Thursday, August 13, 2009

Macro for Paste Special

SOMETIMES you want to paste text in Word, but you don't want it to retain its current formatting. Instead, you want it to adopt the formatting in your document. There's a slow way to do it; a better way; and the best way

The slow way is just to paste in the new text, say "oh, well" to whatever format changes occur, and manually repair the changes.

The better way is to use the Paste Special option, either through the Edit menu or by Ctrl+Shift+V hotkey combination, but even that requires each time you do it that you to select "unformatted text."

The best, as published recently on Lifehacker, and before that on Screened by Slimm, is create a macro and assign it that hotkey. Here's how:

  1. From the View tab, create a new macro named PasteSpecial.
  2. Replace the contents of the code editor with the following text:

    Sub PasteSpecial()
    Selection.PasteSpecial DataType:=wdPasteText
    End Sub

  3. From the Microsoft Office button in the upper left-hand corner, choose Word Options -> Customize, and then click the Customize button next to Keyboard shortcuts at the bottom to bring up the Customize Keyboard dialog.
  4. Choose Macros from the categories list on the left, and then your macro in the Commands box on the right-hand side. Now you can enter in a shortcut key (Ctrl+Shift+V or your own), and click the Assign button.


No comments:

Pages

My Library