As a programmer at a big corporation, I frequently send Outlook emails that contain code samples.
I'll actually type code directly into an email. This inevitably causes problems, as Outlook really likes to format text in pleasing but unhelpful ways. My code needs to be copyable out of the email and directly into code, so I don't want Outlook to mess with it by adding special characters or whatnot.
So I always need to tweak options like:
I also like my code to be in a monospaced font, black, indented, and smaller than other text. I've tried to make a Style for this, but for some reason the Style never saves. :-( [edit: turns out I wasn't telling it to work on "new documents based on this template"]
Is there some way to put code in <pre> blocks or something that tells Outlook to ignore all these rules and format code the way I want it to? If not, what ways have you found to send code snippets in Outlook emails without it getting super annoying?
Per their wiki: A simple plugin for Outlook 2013 which adds a button to the compose mail menu to enable Markdown mode. When enabled your email will be turned from Markdown syntax to html when sending.
If you use Gmail's web client, you can right click on the email and choose “View Page Source.” However, this will show you the entire web page's HTML code, including the message information.
Years later I have a response.
Use an online code highlighter like http://tohtml.com/ to highlight your code so you can paste marked up code from your IDE into Word. Depending on your IDE you may be able to skip this step.
In Word 2010, go to insert->object->openDocument Text. Steps 2-3 are documented at How do you display code snippets in MS Word preserving format and syntax highlighting?.
Paste your highlighted code into the object.
Copy the whole object.
Right-click-> paste special the object into Outlook.
This gives you a highlighted, contained box of code for use in emails in Outlook 2010.
If you have notepad++ installed in your pc, then you can copy text as RTF (Rich Text Format) and paste it in your outlook mail.
1) Paste you code snippet into notepad++
2) From Menu bar navigate to "Plugins -> NppExport -> Copy RTF to clipboard"
3) Paste into your email
4) Done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With