Note: this works only in Outlook 2010 as written, because Outlook 2007 does not support PostItem in Run a Script. We're working on a version for Outlook 2007 that uses ItemAdd handler. We have a code sample that works on RSS feeds delivered to a single folder at Slipstick.com.
Today's tip is one that I expect only a few people will care about… heck, it's not something that I would bother with myself. But a user asked about it and thought up a possible solution, then Outlook Developer MVP Michael Bauer of //vboffice.net/ supplied the code to make it work.
The user's problem:
I don't like reading Calibri 11 in (some of) my received emails and RSS feeds.
He tried all the usual solutions to change the font, none of which worked. I looked into it and discovered that the font used for RSS feeds is hard-coded and users can't change it.
The message source shows the font:
<style><!-- body {font-family:"Calibri";} --></style>
And a run a script rule can easily change it.
ChangeItem Font Script
To use, open the VB Editor (Alt+F11) and paste the following code into ThisOutlookSession.
Public Sub ChangeFont(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
Create a Rule that applies to any RSS feed, with the Run a Script action, selecting the ChangeFont macro.
As new RSS feeds arrive, the font will be changed from Calibri the font of your choosing (Times New Roman, in our sample).
Changing Email Fonts
Can you use this code to change the fonts on incoming email messages? Yes, but it will be hit-or-miss as each client uses different, often multiple, font-families.
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.
Published February 22, 2012. Last updated on May 3, 2017.