views:

348

answers:

4

I've searched around the internet for this, and I'm not finding it...

Is there a way or a add-in you can use that will make code (let's say C#) appear properly in Outlook emails?

I hate when I'm trying to communicate a snippet to a fellow developer, and when you paste it into an Outlook email (which is using Word/HTML as the editor), it looks terrible, tries to all kinds of spell checking on it, and if you have to modify or pseudo-code it, it auto-corrects things like lowercase "i" to capital "I", etc.

I guess I'm just looking for something that does at least as good a job as the code format editor on StackOverflow here, without me having to disable HTML entirely in Outlook. If there was something that did code highlighting, that would rock.

I guess I should also specify that I'm really talking more about being able to write new code right in an outlook window, not paste it in. I could just paste in code from Visual Studio and it would come in as HTML, but I'm one of those people with a dark background, and it looks terrible to have that much formatting.

+2  A: 

You should look into using PasteBin.com or CodePaste.net

Neil N
Hmmm...only problem with these might be that a client might not want even snippets of their code living out on the internet...
Sam Schutte
+3  A: 

Better yet, why not try Rick Strahl's CodePaste.net? It provides a simple way to Twitter, email, and otherwise share code snippets. If you're really set on emailing those snippets, you could use the site to format your code snippet, then copy/paste the html view of it

Josh E
I'll check these out too.
Sam Schutte
+1  A: 

I got part-way there by just playing with styles in Outlook (2007). I was able to create a "code" style that uses Consolas 8pt font (fixed pitch font). I also turned off leading/trailing line spacing, so the code within that style is single-spaced.

However, I could not find a way to turn off case correction based on the selected style. (if anyone knows how to do that, I'd love to see the post -- maybe I just missed something basic)

JMarsch
I think this is probably closest to the answer I was looking for. You can just set up this style and then highlight the code you want to look that way, and it will make it look right. The autocorrect is definitely annoying though. I believe there's an option to turn that off, but not from a style.
Sam Schutte
A: 

Try this for outlook http://www.fauskes.net/nb/syntaxms/

metal-gear-solid