• Fixing line spacing in Outlook 2007 email signatures with a bit of help from Visual Studio 2008

    by  • September 16, 2009 • gmail, html, outlook • 1 Comment

    Today I’ve been trying to generate an e-mail signature in Outlook 2007 which renders well in Google Mail also, with some success. The signature consists of a two column table, with an embedded image on the left, and all the details running down the right.

    As the client is using Outlook 2007 and wants to be able to add a signature on all outgoing mail, I began by using Outlook 2007’s rich text editor, creating a two column table and adding all the relevant details. I sent it for a quick visual check with Google Mail — Spot the differences:

    Rendered in Outlook 2007:

    line-breaks-rendered-in-outlook

    In Google Mail:

    line-breaks-rendered-in-gmail

    i.e. completely different. Aside from the slightly different width which I can live with we’ve got three main issues: the font family and line spacing is different and the table padding is also out, making the table approximately twice as high as it should be. Try as I might with setting the font family in Outlook (selecting text and forcing anything other than Arial), Google Mail didnt want to play ball, refusing to display text in anything but Arial! OK, so compromise made – Arial it is!

    Line spacing was an interesting one – I’m not sure if its some interaction with the markup Outlook generates (hideous when viewed in FireBug) which the web browser is unable to make sense of but there is an obvious difference. So, in my frustration with not being able to see what HTML was being generated by Outlook’s rich text editor (MS — please please please rectify this for Outlook 2010), I opened Visual Studio, created a new HTML file and began typing markup, recreating the right hand side of the table using <p> tags and <br> for line breaks, so for the tel/fax/web details something like:

    <p style=”color:Red”>Tel<br />Fax<br />Web<br /></p>

    I put Visual Studio into Design mode, selected and copied the p tag from the visual view, pasted it into Outlook, which looked as it should, and then sent it out to test how it rendered in Google Mail — this is what I got.

    line-breaks-rendered-in-gmail-after-paste

    Which is something a little closer to how Outlook renders the email, with <br> tags intact. So, one less problem to deal with, hope this helps someone (or if there are any easier ways to achieve this please leave a comment!)… I might have to live with the font family and padding issues!

    About

    .NET developer at thetrainline.com, previously web developer at MRM Meteorite. Awarded a PhD in misbehaviour detection in wireless ad-hoc networks.A keen C# ASP.net developer bridging the gap with APIs and JavaScript frameworks, one web app at a time.

    http://www.paulkiddie.com

    One Response to Fixing line spacing in Outlook 2007 email signatures with a bit of help from Visual Studio 2008

    1. November 2, 2015 at 10:48 pm

      I have tried for over an hour now to respace my signature in outlook using the shift enter solution and the top 3 lines worked nicely and are now single spaced but the bottom details will not change from double spaced to single spaced I have tried retyping from scratch, copying from email etc. etc… maddening any solutions?

    Leave a Reply

    Your email address will not be published. Required fields are marked *