Monday, 14 July 2008

Outlook - inserting HTML code snippets into an email

Sometimes there is a need to insert some HTML code or scripting into an email for a signature or to send some externally resident content to someone.

To do this in the body of an email:
  1. In Notepad paste the required code and save as an HTML file.
  2. Open Outlook
  3. Start a new email
  4. Click on Insert
  5. Find the HTML file that contains the needed code.
  6. Click the down arrow beside the Insert button.
  7. Click on "Insert as Text".

    • Insert as Text

  8. The finished code rendering will show up:

Note that Outlook 2007 no longer allows code snippets inserted into the signature. There are ways to get around this, but given the nature of many spam filters out there ... the risk of losing that email may be too high.

Outlook 2003 provides a "Use HTML as Template" option that we can insert into a signature though. Keep in mind that the email may never reach its destination as a result.

Tip source: SitePoint Forums: Inserting simple HTML into Outlook.

Philip Elder
MPECS Inc.
Microsoft Small Business Specialists

*All Mac on SBS posts are posted on our in-house iMac via the Safari Web browser.

7 comments:

Anonymous said...

My Outlook 2007 does not show an Insert File dialog. I can insert a file via Insert Object, but the dialog is completely different. Do I need to enable something to view the Insert File dialog you reference?

Thanks ---

Philip Elder Cluster MVP said...

Paul,

In the blog post, click on the image under "Insert as Text" to see the full view.

There is a little down arrow on the right side of the Insert button that you click on to bring up the menu.

Are you saying that you do not see that arrow?

Philip

Anonymous said...

Phillip - thanks for the quick reply. The Insert File dialog box that the image shows does not appear in my Outlook installation. I can work around it, but the resulting email body does not include all the html features of the source file - background image, etc. Also - if I try to use File | Send | page by e-mail from IE7, the resulting email body does not include all of the source HTML. Seems to be a general Outlook HTML rendering issue.

Philip Elder Cluster MVP said...

Paul,

Welcome.

On a domain? Group Policy setup to manage your Outlook installation?

The install routine too may be a factor in that feature not showing up.

I will have a look at some other domain and non-domain Office 07 installs to see if this is the case there too.

It does seem strange that the down arrow would be missing for you.

Philip

Anonymous said...

I tried this technique in a meeting request but the HTML just showed up as code...any way to insert HTML or linked graphics into meeting requests?

Anonymous said...

Make sure to enclose the code in html tags

Alexei said...

I cant insert object tag with this method. Outlook removes all object tags