Thursday, July 31, 2014

Adjusting Outlook's default new message with styles, templates, and signatures

I had a heck of a time figuring out how to ensure Outlook always started with a format I liked. It turns out this is more complicated than anyone would imagine. But once I explain it, you should be able to make your changes in about ten minutes. You'll be able to click new message and just start typing without making any formatting adjustments. (Sorry this is so long and has no pictures. If I didn't have a day job, I would add screenshots.)


First, make sure you're using html as your default message format. I always use html when possible (I won't do that if I know I'm communicating with someone on a phone that would be annoying to try to read in anything but plain text.)

Identify the files you need to change.
There are four things you need to change to make your default e-mail look the way you want: 
  • the Microsoft Word template e-mail file (.dotm)
  • an Outlook stationery file (.htm)
  • a theme in the Word template (.thmx)
  • a Style Set in the Word template (.dotm)


Think of the template file as the and the stationery as the paint pallette and the stationery as the canvas. The theme is your set of colors, which you've chosen because they coordinate and are appropriate for your subject, and the style set is the set of brushes and knives you'll use with the colors. If you want to start with a blank canvas, your stationery htm file shouldn't have anything in it. But you could insert watermarks or standard language in it as well.

The stationery is saved at %AppData%\Microsoft\Stationery. You can create your own file and make it your default stationery. Save it to this folder to ensure Outlook knows where it is. (I call mine PSRBe-mail.htm because I work at Plews Shadley Racher & Braun and this is my work stationery. It has one empty paragraph with text formatted the same as my default Body Text.)

Note that you can make changes to stationery files while Outlook is open, but you have to close Outlook to change the template.

Make your changes.
You need to make the changes to the right file. Remember, the template is your pallette. It contains all your colors and tools. Mostly what I’m talking about are styles (you must learn how to use style in Word and Outlook if you want to get your money’s worth—otherwise, their just glorified typewriters). The stationery contains your canvas; it makes a blank e-mail look like it does (minus any signature). If you put text in the template or change a style in the stationery, those changes won’t show up in your messages. The template is also where your macros are stored.

Change the template
Make sure Outlook is closed.

Because I want to change how all new messages look and behave, I want to edit Outlook’s default template. You can find the template at %AppData%\Microsoft\Templates\ The file is NormalEmail.dotm. (I’m using Windows 7 and Office 2010.) Right-click on the file, and select Open. (If you ever want to start over, just close Outlook, rename NormalEmail.dotm, open Outlook, and create a new message. Outlook will re-create the file with all the defaults.)

Theme
First, make sure you have your theme selected. (Or, first, learn what themes are.) Most important, select the font you’d like for body text and headings. These settings will apply to all styles and fonts you have selected that have (Body) or (Headings) after the typeface’s name. Themes also provide the colors and effects for these. I save my themes where Word saves all the themes: %AppData%\Microsoft\Templates\Document Themes.

Styles
Next put together the styles you want to use. To make things consistent, I recommend using only the typefaces with (Body) or (Headings) after them. That way, if you ever decide to switch the font of all your body or all your headings, all you have to do is make the change to your theme.

The template will also save the Quick Style Gallery, so make sure all the styles you need are there and in the order you want them to appear. (That’s another lesson, isn't it?)

Save the Style Set
Make sure to save your Style Set. I call mine E-mail. It’s saved where Word saves them by default: %AppData%\Microsoft\QuickStyles.

Now Style Sets don’t work as seamlessly with Outlook as they do with Word. I have spent hours trying to fool Outlook into doing what I want. The biggest source of frustration I have is with the behaviors of the styles. I can't find a way to set the text to my Body Text style by default. But that’s just a click away: When I select Body Text from my Quick Style Gallery, the text looks just the way I want, though I had to experiment with some of that style’s settings to get it to behave as anticipated.

 

Change the stationery

Create a new Word document. Set the empty paragraph to  the font and size you want every message to have (sorry, you can't use styles in the stationery). Add any images or other elements you want. (I leave mine blank.) Save the file as an .htm file here: %AppData%\Microsoft\Stationery.


Set Outlook to use the new stationery
This is in Options>Mail>Stationery and Fonts>Themes and click Theme. That will bring up the list of all available stationery, which should include yours if you saved it at the right location. Note that replies and forwards will only use stationery if you have replies set to Do not include original message or Attach original message. These work because they start with a blank message. Otherwise, Outlook uses the formatting form the existing message. I have mine set to include the text of the original message in both, so I don't have my stationery doing anything in replies or forwards. But I always change the Style Set to my e-mail set whenever I have more than a single line in a reply or forward.


Set your signature for new and reply messages
This is pretty straightforward. Here is one place with some directions. https://office.microsoft.com/en-us/outlook-help/create-and-add-an-email-message-signature-HA010352514.aspx I like to create my signature in a new message and copy and paste because the formatting options are very limited in the signature dialog, but Outlook will recognize any of the formatting you paste into a signature block. You can't insert an attachment, though.



I use a minimum of four signature blocks: a Default, a Reply Default, a block with all my contact information, and a block for interoffice mail (this has my internal extension, which is only useful for my on-site coworkeers).

BONUS: Delete extra lines automatically created

For some reason, Outlook automatically inserts a couple empty paragraphs before your signature. If you're like me and want total control over the formatting of your html messages, there’s some VBA code to delete those lines. I found it here: http://www.pcreview.co.uk/forums/outlook-2007-inserts-2-lines-before-signature-t3613164.html. It says it's for Outlook 2007, but I've found it works on Outlook 2010. The problem with the solution at the link is that I found it deletes one paragraph too many, so I altered the code to remove only one rather than two. Please let me know if you have a better solution.

Here's what to do:
Go to the VBA editor

Open ThisOutlookSession module

Paste this:
Option Explicit

' clsInspector class will remove additional 2 lines from outlook signatures
Dim Insp As clsInspector

Private Sub Application_Quit(): Set Insp = Nothing: End Sub
Private Sub Application_Startup(): Set Insp = New clsInspector: End Sub

Save it and open a new class module entitled clsInspector with this code:
Option Explicit

Dim WithEvents oAppInspectors   As Outlook.Inspectors
Dim WithEvents oMailInspector   As Outlook.Inspector
Dim WithEvents oOpenMail        As Outlook.MailItem

Private Sub Class_Initialize()
 Set oAppInspectors = Application.Inspectors
End Sub

Private Sub oAppInspectors_NewInspector(ByVal Inspector As Inspector)
 If Inspector.CurrentItem.Class <> olMail Then
  Exit Sub
 End If
  Set oOpenMail = Inspector.CurrentItem
  Set oMailInspector = Inspector
End Sub

Private Sub oOpenMail_Open(Cancel As Boolean)
On Error GoTo e
 Const wdStory = 6
 Dim objDoc, objSel
 Set objDoc = oMailInspector.WordEditor
 Set objSel = objDoc.Windows(1).Selection
 objSel.Move wdStory, -1 ' start of editor/signature
 objSel.Delete ' line 1 
e:
 Exit Sub
End Sub

Private Sub oOpenMail_Close(Cancel As Boolean)
 Set oOpenMail = Nothing
 Set oMailInspector = Nothing
End Sub

Private Sub Class_Terminate()
 Set oAppInspectors = Nothing
 Set oOpenMail = Nothing
End Sub

This was a very complicated task. I spent a lot of time trying to figure it out, and most was trial and error. I'm posting it because I couldn't find much help on the Internet, not because I'm confident this is perfect. If you have suggestions to improve this, please let me know.

1 comment: