views:

1667

answers:

7

Is there any way to force Visual Studio to copy selected code to the clipboard as unformatted text?

When I am copy-pasting code into Word or more often Outlook I have to do it via Notepad to get rid of the formatting...there has to be an easier way!

+1  A: 

When I do it choosing the little pop-up menu option attached to the wee clipboard item "Match Destination Formatting" does the trick for me.

Office 2003 features that option in Word, but not Outlook.(I think that Outlook 2007 has it though...)
Richard Ev
Well why not set the format of the mail to plain text? Or do you have some fancy signature with bold and hyperlinks and what have you?
Fancy signature...oh yes! Our corporate standard signature uses Arial in a specific shade of blue, formatted in an HTML table with our company logo...
Richard Ev
Bah, oh well, via Notepad seems to be it then...
+1  A: 

You might find http://www.extrabit.com/plaintextclipboard/ to be a useful tool. Some applications have a paste option which strips formatting, but what you really need is a copy operation that strips formatting, which VS does not offer.

Brian
I've seen this called a "clipboard scrubber". A similar program is ClipboardFusion - http://www.binaryfortress.com/clipboardfusion/ . Instead of copy-paste, the operation becomes copy-paste-realize it is ugly-scrub clipboard-paste.
Patrick Szalapski
Or PureText, as another answer suggested.
Patrick Szalapski
+5  A: 

Visual Studio does put unformatted text on the clipboard, but it also puts formatted text. (The clipboard supports multiple simultaneous formats, and the OS assumes that they're simply different representations of the same data, although there's no technical enforcement of that point.)

The application you're using to paste then chooses its preferred format. In Word, and maybe Outlook as well, there is a "Paste Special" command that allows you to choose which format you want to use.

Rob Kennedy
Paste Special is the way I do it
revs
For some reason "Paste Special" always seems to be disabled in Outlook 2003
Richard Ev
It's enabled for me in Outlook 2007, so I don't know what else to say. Good luck.
Rob Kennedy
Paste Special is not present in many apps.
Patrick Szalapski
Patrick, the applications that don't support "paste special" are also usually the ones that don't support formatted text anyway. They'll always select the unformatted text because that's the only thing they check for and the only thing they support.
Rob Kennedy
Unfortunately, that isn't true about Microsoft Office Communicator, which I paste into all the time.
Patrick Szalapski
A: 

This Microsoft Office site offers a workaround that involves writing a macro to replace ctrl+v functionality to paste plain text all the time, but that may not be what you want. You can alternatively remap an unused shortcut (ctrl+?) to provide you with this functionality so you don't have to keep enabling / disabling the macro.

Mick
+7  A: 
Michael Paulukonis
Beautiful and free! I expected it from your description to be payware and was going to sit up tonight and make a free replacement, yet lo and behold, it's free software! Thanks for sharing: )
Computer Guru
A: 

Clipboard recorder will let you paste things in plain or formatted text. I used it every single day; it's one of the most useful tools I have. It's become a crutch!

Adam Neal
A: 

For applications that do not have a "paste special" you could use an application like PureText

Rich Alger