Copy-paste code from Visual Studio, but paste UNFORMATTED code

Richard Ev picture Richard Ev · Feb 5, 2009 · Viewed 20.1k times · Source

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!

Answer

Rob Kennedy picture Rob Kennedy · Feb 5, 2009

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.