I have custom settings in Visual Studio that include a dark background. Copy/pasting to Outlook produces a crime against eyeballs with a dark background in code on a white background of the mail.
Does anyone have any ideas of how I can paste code in standard VS formatting (NOT unformatted text from paste special, and not paste with my custom VS formatting)?
(Alternatively, does anyone know a quick way to switch between themes in VS? Thinking that could also work...)
The following blog post details how to address this issue in VS2012:
Ok so the closest I got was using CopySourceAsHtml which also allows you to define custom css styles for that copied html. I peeked at the css styles when copying code from the default VS theme and copied them over.
Got me 90% there which is good enough - no black code backgrounds on white email backgrounds!
This free VS Extension (named "Copy As HTML") allows you to choose the background color when copying to clipboard:
This is a lightweight tool that allows you to copy code from the Code Window and convert it into HTML while preserving syntax highlighting, indentation and background colour.
This add-in adds a command to copy in plain text: VSHelper
来源:https://stackoverflow.com/questions/1867555/visual-studio-copy-paste-into-outlook-with-standard-formatting