[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Outlook 2010 VBA to remove delete contents in subject line

Posted on 2011-09-14
Medium Priority
Last Modified: 2012-11-19
I am trying to run a Outlook rule that will run a script when receiving messages from a particular  email address.  I wan the script to delete the contents of the subject line.  Can someone help me with a script because I have never worked with VBA.  
Question by:beta2028
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 14

Expert Comment

by:Alexei Kuznetsov (Outlook MVP)
ID: 36538338
Something like this:

Sub ClearSubject(Item As Outlook.MailItem)
    Item.Subject = ""
End Sub

Open in new window


Author Comment

ID: 36538945
That didn't work.  I added this to the ThisOutlookSession and then saved the code.  Then ran the script as a rule and it did not clear the subject.  I even tried to run the rule manually and it didn't clear it either.
LVL 14

Expert Comment

by:Alexei Kuznetsov (Outlook MVP)
ID: 36541153
Believe me it works. Looks like you have macro security enabled.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 14

Expert Comment

by:Alexei Kuznetsov (Outlook MVP)
ID: 36541155
Or you just misconfigured your rule.

Accepted Solution

beta2028 earned 0 total points
ID: 36542699
You are correct it was the Macro security.  No wonder I couldn't get any scripts to work.  One last question.  If the subject is Ticket #xxx-xxxxxxx how do I take the Ticket # out of the subject and keep the numbers?  Thanks in advance and getting this to work for me.  

Author Closing Comment

ID: 38612247
Issue resolved

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
Changing a few Outlook Options can help keep you organized!
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question