I don’t have much (any?) history of posting tips for the Windows platform, but I’m currently stuck with it for daily work use, so I figured I might as well share some tips that my readers who happen to be in the same predicament will find useful. (Planet Debian readers please have mercy.)

One of the worst things you that Microsoft Outlook allows a user to do is select a “stationery” for email. Stationery goes beyond regular old HTML mail (e.g., fonts, colors, and bullet lists) to add a patterned background, invariably rendering the content much less readable than it would be with a white (or even any other color) background. What’s worse is every reply to an email with stationery also adopts the original sender’s stationery!

I searched quite a bit for a solution that does not involve sending a nastygram to the original sender. Of course you can convert the email to plain text (or set Outlook to only display the plain text version) and then convert back to HTML or Rich Text, but you’ll also lose other formatting that you might want to retain. You could cut and paste the text into a new email, but what is really needed is a simple VBA macro that will strip the stationery but not other formatting.

Strangely, I don’t think that macro already exists. So I wrote one, to some extent cribbing from related code snippets (mostly from here). I now present to the world ClearStationery.bas, my best contribution to date to the Outlook ecosystem. Simply paste it into your Outlook Visual Basic Editor (ALT-F11) and then map the macro ClearStationeryFormatting() onto a toolbar with a hotkey, and you can instantly remove stationery from any email, whether it is in the “preview” pane or the full message view.

34 comments

I have to use Windows XP and Outlook for work. I did try using Evolution with Exchange a few years back and got mixed results. My current workplace has many tightly integrated (some home-grown) systems, all Windows-based, several of which don’t run under Wine. I’m pretty much stuck for the foreseeable future.

Nice job on the code! I have similar code on my site. You might want to consider using line continuations (underscores) to make the code more readable. The text box on the blog is not wide enough to display the code properly.

Changing the font etc. can be done through the Outlook interface, while removing the stationery background cannot be done (to my knowledge) except with my script posted here. I agree a nice revision would be to remove the stationery font tags, and it probably wouldn’t be hard to do based on my existing code, so I’ll try to get it to it sometime.

Great piece of code!!! I needed one to do just what this one does, thank you very much. Before I found this one, I found one that I was able to call through an outlook rule. However this one does not show up on the list of available scripts to run when I try to set this up. I know very little about VBA (that is to say I know how to get to the editor), so please help me. Why does it now show there, when it is plainly in the editor and I can run it manualy.

Matthew: I don’t know the answer to your question. I’ve had that problem before, and I think ultimately I had to implement the VBA hook entirely encode without using the “rules” interface at all. I just set this script up to be a keystroke-activated macro on a toolbar, and only use it when I need it (i.e., on emails with annoying stationery).

I’m a unix person forced to use outlook. After I type Alt-F11 I get Visual Basic, but I have no idea how to “map the macro ClearStationeryFormatting() onto a toolbar with a hotkey” What do I do next? I can’t just paste the code. Can someone tell me click this, click that, paste, do this, do that
I don’t even see File->Exit in the Visual Basic window.

After removing the stationary, how do I force background color? Idiots here used everything from black to white, with a lot of pastels, and they change depending on the phase of the moon. Simply forcing font color doesn’t work.

Bruce — just right-click on the toolbar and choose “customize,” then you should be able to drag your macro onto the toolbar to execute it. In my experience, it’s always removed the background color etc., I haven’t found it necessary to do any further customization.

Thanks, but after the rule runs now I am seeing black text on a black background. ??? My defaults are black background with white text. Most people (here) use bright backgrounds with “auto” color. What’s going on?

Adam — this looks great. But I confess I have no idea how to paste your VBA macro into outlook visual basic or how to map it. Would you be willing to provdie a short step by step tutorial? I really need this macro. thx.

Excellent code! One question: A lot of emails I see with stationary also seem to have a double carriage return on Enter that carries into the reply message as well. What could I add to the VBA code to remove that pesky feature?

Thank you so much. First time I’ve ever created a macro so I kind of fumbled through the process. basically created a Module, pasted your code into that module then figured out where the Macro was in the Ribbon.

Works very nicely. Only one thing can it remove the stationary automatically when I receive a message?

I receive a lot of emials.
That i Want is identify a html format, to export valules that comes into a table, to a excel application, automatically.

I am running this script like a rule.

The problem is that my initial scrpit, not function when the table into email with html format, comes in a different position, because i am reading it like a text format.

I tried to change especial characters like vbCrLf by “;”, but if the table change the position, i could not find the values at the same position.

I appreciated your comments, I want to read this email like a html format, to identify the tags.

Sub GetData()

Dim msg As Outlook.MailItem
Dim rows As Variant
Dim numberofColumns As Long
Dim numberofRows As Long
Dim headerValues As Variant
Dim headerRow() As String
Dim data() As String
Dim i As Long, k As Long, j As Long
Dim cont As String
Dim Val As String