6

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?

  • 2
    Why don't you just put the code in an attachment? – Ramhound Feb 28 '14 at 16:37
  • 1
    Alternatively, you could also just disable spell checking :) – Richie086 Feb 28 '14 at 17:04
  • 2
    I don't want it always disabled – JoelFan Aug 15 '17 at 17:45
9

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".

1

You can actually create a style for code that disables spellcheck in addition to, say monotype font and so on... After that you can assign keyboard shortcut to this style and use this shortcut to quickly format you code snippets.

0

You don't say which version of Outlook you're using, but if you're on 2007 or 2010, the "Adding a 'Paste Code' feature to Outlook 2010/2007" blog entry might be useful to you.

In summary:

  1. Enable macros
  2. Enable "Developer Mode"
  3. Add a form using "Form Manager"
  4. Add the VBA code (macro)
  5. Create buttons to allow you to "Paste Code"

All the needed steps are outlined in the blog entry, including VBA code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.