Monday, 1 October 2007

Paste Unformatted Macro - Copy easily from Trados Concordance into Word

Paste Unformatted Macro - Copy easily from Trados Concordance into Word


Problem:
Whenever you copy text from, say, the Web, and try to paste it into a Word doc, or, specifically to an open segment of Trados, Wordfast, Metatexis, etc, Microsoft Word retains the format of the text and wrecks your segment (This is especially true with Trados, even in case you copy the search results of a Concordance search)!

You can select Paste Special from the edit menu instead of Ctrl+V or if you have Word XP you can select the appropriate option from the smart tag that appears after the paste (not applicable when working within a segment created by a translation memory application), but it is all rather cumbersome.

Solution:
Like so many annoying things of Office, a little macro can solve this idiosyncrasy. Start Word and bring up Visual Basic for Applications (VBA) by pressing Alt+F8 or clicking Tools > Macro > Macros. Type a macro name in the box, say, PasteUnformatted, and click Create.

The Microsoft Visual Basic Editor will appear with the following lines:

Code:
Sub PasteUnformatted()
'
' PasteUnformatted Macro
' Macro created 10/18/2001 by Spiros Doikas
'
End Sub

Immediately before that End Sub line paste the following:

Code:
Selection.PasteSpecial DataType:=wdPasteText

So that your macro now looks like this:

Code:
Sub PasteUnformattedText()
'
' PasteUnformattedText Macro
' Macro created 3/5/2005 by Spiros Doikas

Selection.PasteSpecial DataType:=wdPasteText
End Sub

Click File > Close and return to Microsoft Word.
Now, you need to tell Word to run that macro every time you press Ctrl-V or, if you want to retain Ctrl-V as it is you can use Alt+V (my favourite) or Ctrl+Alt+V (Do not use Ctrl+Shift+V because it is the default shortcut for pasting formatting).

• Click Tools > Customize.
• Make sure Save In shows normal.dot among the file types and click the Keyboard button.
• In the Categories box, pick Macros.
• In the Macros box, choose your macro (in this case, PasteUnformatted).
• Click inside the Press new shortcut key box and hit Ctrl-V or Ctrl+Alt+V.
• Click Assign.

You're done! From now on, every time you press Ctrl-V or Ctrl+Alt+V, you can paste the contents of the clipboard into Word, Excel, Outlook, Trados, Wordfast, Metatexis etc. without any formatting.

2 comments:

John said...

Hi Spyro, what you describe is useful in many more situations. Another way to fo this is using PureText, this is a freeware app.

Greek Translator said...

Indeed, you are right. And here is the link to PureText http://www.stevemiller.net/puretext/