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

前端 未结 9 1806
春和景丽
春和景丽 2021-02-11 15:34

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

9条回答
  •  闹比i
    闹比i (楼主)
    2021-02-11 16:00

    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

提交回复
热议问题