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

前端 未结 11 1264

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

11条回答
  •  [愿得一人]
    2021-02-11 16:08

    From this blog post I got these instructions for getting rid of the black background when copying & pasting out of VS with the 'Dark Theme' activated, but the html in it can be tweaked to alter the rest of the formatting as required (e.g. set all text to black).

    If required, install Productivity Power Tools

    Open Tools → Extensions and Updates

    Select Online (Visual Studio Gallery) and search for Productivity Power Tools 2012/2013

    Download and restart Visual Studio when prompted

    Productivity Power Tools Settings

    Open Tools → Options → Expand Productivity Power Tools select HTML Copy

    Change the BeforeCodeSnippet option to:

    
    

    Change EmitSpanClass to: True

    Check EmitSpanStyle is: True

提交回复
热议问题