Solved

Outlook 2010 VBA to remove delete contents in subject line

Posted on 2011-09-14
6
366 Views
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.  
0
Comment
Question by:beta2028
[X]
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
6 Comments
 
LVL 14

Expert Comment

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

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

Open in new window

0
 

Author Comment

by:beta2028
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.
0
 
LVL 14

Expert Comment

by:Alexei Kuznetsov (Outlook MVP)
ID: 36541153
Believe me it works. Looks like you have macro security enabled.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 14

Expert Comment

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

Accepted Solution

by:
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.  
0
 

Author Closing Comment

by:beta2028
ID: 38612247
Issue resolved
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
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: …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

691 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