Outlook – How to send programming code snippets in Outlook

emailmicrosoft-outlook

I sometimes include a programming code snippet in an Outlook email and it's a very distracting and frustrating experience, because Outlook has an assumption that everything in an email message is natural language (e.g. English). So it tries to flag "spelling errors", attach links and other such non-helpfulness. How can I get Outlook to not do that please? Is there some kind of "leave this text alone" (or "leave this message alone") option, kind of like the <pre> tag in HTML?

Best Answer

I've had similar frustration when sending configuration output from a router or switch in an email, and I fixed it by creating a new style, and "stealing" the HTML of code snippits on Stack Exchange.

For example:

{master:0}
user@switch> show configuration chassis 
alarm {
    management-ethernet {
        link-down ignore;
    }
}
  1. Steal a Sample and Create a New Style

    I liked how the above looked so much that I simply copied the text above, and pasted it in a new email in outlook. Then, select it, click styles, then "Create a New Style":

    Create a Style Prompt

  2. Name it, and Modify it

    Then I gave it a name and clicked "Modify" to look at the more advanced options:

    Create New Style from Formatting

    You want to disable Spell Check, for example. Go to "Format" then "Language" then check "Do not check spelling or grammar":

  3. Save It

    Anyway, from there you opt check the option for "New documents based on this template". Click "OK".

IMPORTANT

This will NOT SAVE for future emails unless you save it as a "Style Set"

Go to "Format Text" on the ribbon, then within "Styles", click "Change Styles" > "Style Set" > "Save as a New Style Set". After naming and saving it, you'll have a style set you can return to. If you want this as your default style set (you probably do), click the "Change Styles" button again, and click "Set as Default".

Related Question