How to Change the Font used for Outlook's RSS Feeds

Last reviewed on October 3, 2012

One of the tips we shared with our Outlook Daily Tips readers was how to use a Run a Script Rule to change the font used with RSS feeds.

Note that this will not work with Outlook 2007 RSS Feeds as it does not support PostItems in Run a Script rules. You can use Run a script rules with MailItems. You need to use ItemAdd event handler with Outlook 2007's RSS Feeds.

A user disliked Calibri font and wanted to change it but gave up after changing fonts "everywhere" in both Outlook and Internet Explorer and not affecting the RSS feed font. He posted the question in a forum and no one there knew either, so I asked the people who worked on the RSS feature at Microsoft. The answer: The font is not exposed to end-users.

The user thought that maybe it would be possible to do it using a Run-a-script rule but had no idea how to write the script. Outlook Developer MVP Michael Bauer of http://vboffice.net/ supplied the code to make it work. (Michael has quite a few very useful code samples on his site BTW.)

We first check the message source so we can see how the font is set.

<!-- body {font-family:"Calibri";} -->

Because its hard-coded in the message, changing fonts in Outlook won't help; we need to change the message source. Fortunately, a run a script rule can change it.

The Solution

Begin by pasting the code into ThisOutlookSession in the VB Editor.

Open the VB Editor (Alt+F11), expand the folders on the left to locate ThisOutlookSession, then double click to open it on the right side of the screen. Copy the code and paste it into ThisOutlookSession. The code colors should be black, blue and green. If any lines are red, there is a error.

Public Sub ChangeRSSFont(Item As PostItem)
  Dim b$, NewFont$, OldFont$
  
  NewFont = "{font-family:" & Chr(34) & "Times New Roman" & Chr(34) & ";}"
  
  OldFont = "{font-family:" & Chr(34) & "Calibri" & Chr(34) & ";}"
  b = Item.HTMLBody
  b = Replace(b, OldFont, NewFont, , , vbTextCompare)
  Item.HTMLBody = b
  Item.Save
End Sub

Use a Run a Script Rules to change the fontNext, you'll create a Rule that applies to any RSS feed, with the Run a Script action, selecting the ChangeRSSFont macro.

As new RSS feeds arrive, the font will be changed from Calibri the font of your choosing (Times New Roman, in our sample).

Can you change more than the font? Sure. It's just CSS so you can use any CSS attribute that is supported in the Body tag.

One useful change is to a larger font. For this you will add the font-size attribute to the NewFont code:

  NewFont = "{font-family:" & Chr(34) & "Times New Roman" & Chr(34) & ";font-size:14pt;}"

Any valid font-size will work, including %, pt, px, large, or larger.

Changing Email Fonts

Note: This is supported by both Outlook 2007 and Outlook 2010's Run a Script rule.

You can use also use this code to change the fonts on incoming email messages, but it will be hit-or-miss as each client uses different, often multiple, font-families.

First, you will need to change "(Item As PostItem)" to "(Item As MailItem)" and get the correct line for the OldFont from the message source and format the NewFont appropriately.

Because the code can vary so much and because when multiple fonts are listed, the first is used if it exists, you can replace just the first part of the attribute and it will apply to most messages using the old font. You could even replace just the font name, but this could have unexpected results.

To replace just this part of the code:

font-family:"Calibri" 

Your NewFont and OldFont code will look like this:

 NewFont = "font-family:" & Chr(34) & "Times New Roman" & Chr(34) "
 OldFont = "font-family:" & Chr(34) & "Calibri" & Chr(34) "

To use, paste the code below into the VBA Editor, change the fonts as needed then create a Rule using the Run a Script action, selecting the ChangeMailFont macro.

As messages arrive meeting your conditions, the font will be changed from Calibri the font of your choosing (Comic Sans in this sample).

Public Sub ChangeMailFont(Item As MailItem)
  Dim b$, NewFont$, OldFont$
  
  NewFont = "font-family:" & Chr(34) & "Comic Sans" & Chr(34) "
  OldFont = "font-family:" & Chr(34) & "Calibri" & Chr(34) "
  b = Item.HTMLBody
  b = Replace(b, OldFont, NewFont, , , vbTextCompare)
  Item.HTMLBody = b
  Item.Save
End Sub

The VBA code sample to change the font in Outlook 2007's RSS feeds is on page 2: Use ItemAdd event handler.

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Please post long or more complicated questions at Outlookforums.

2 responses to “How to Change the Font used for Outlook's RSS Feeds”

  1. Ron R.

    Currently Outlook 2010 Win7. I use 3 different email addresses, one profile, one pst file, 3 accounts. I would like when I receive mail to have the emails from the 3 be colored differently for easy identification. I remember in outlook express, I could do this. I don't see an option/feature for this in Rules. Can you help? Thanks, Ron

Leave a Reply

If the Post Coment button disappears, press your Tab key.