Friday, January 13, 2006

Paste Special macro in Word

Control formatting of pasted text

When you paste text that you copied from most other applications into Word, the text retains the font size and formatting it had in the original application. To avoid this in Word 2000 and earlier, you had to paste the text by choosing Edit | Paste Special and then selecting Unformatted Text. Word 2002 has a paste pop-up that makes it even easier to paste unformatted text.

You can create a macro to perform this action for you. Start by creating a macro with a name like PasteUnformatted, which records the steps you just performed. You must then edit the macro by hand, because Word's macro recorder does not correctly record your choice of Unformatted Text. In the macro editor, replace the line Selection .PasteAndFormat (wdPasteDefault) with Selection.PasteSpecial DataType:=wdPasteText, Link:=False.

No comments: