Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Outlook 2010 talking to an Exchange Server (of which I have zero ability to influence change on), so this must be a client-side solution.

Anyway, I'm looking for a way to strip "garbage" text that is always added to the bottom of message I receive from certain domains.

For example, I'll get something like this...

XXX: Sprocket, Cog [ABC] [123] [XYZ, 456]

All the stuff from the first '[' on is garbage to me and I want to get rid of it automatically on receipt by Outlook.

Any suggestions?

share|improve this question

You'll probably have to create a macro that's triggered by mail coming in.

To get you started, Microsoft offers an example on catching this event in KB292063 - "How to create a custom rule using Visual Basic for Applications (VBA) in Outlook 2002" (Still applicable to OL2010).

From there you'll want to use VBScripts's RegEx (regular expressions) to do a Replace on the matching text pattern (replace the pattern with nothing/blank).

For example, using a regex search pattern of \[.+\] will find/match [ABC] [123] [XYZ, 456] in the given example string. This web-tool will help you ensure your RegEx patterns are agreeable to VB's RegEx.

If you are new to VBA macros, perhaps check out MS' "Getting Started with VBA in Outlook 2010".

If you have specific VBA programming questions as you go, check out

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.