title: Change incoming Outlook mail subject
body: <p>I have a rule running on incoming mail that moves items with a certain string in their subject line to a folder. It then runs a script to replace part of the subject with something else.</p>
  
  <p>I've put break points in the script to make sure it's running and not a macro security issue. It reads the subject but just won't save the change. I got the script from someone looking for a similar result</p>
  
  <pre><code>Sub RunAScriptRuleRoutine(MyMail As Outlook.MailItem)
  Dim strID As String
  Dim olNS As Outlook.NameSpace
  Dim olMail As Outlook.MailItem
  
  strID = MyMail.EntryID
  Set olNS = Application.GetNamespace("MAPI")
  Set olMail = olNS.GetItemFromID(strID)
  ' do stuff with olMail, e.g.
  olMail.Subject = Replace(objMail.Subject, "[Jira]", "something else")
  olMail.Save
  
  Set olMail = Nothing
  Set olNS = Nothing
  End Sub
  </code></pre>
  
  <p>I know the above is overkill, so I've also checked it with much simpler code but still no success, it just keeps the same subject line that it came in with.</p>
  
  <pre><code>Public Sub Whatever(Mail As Outlook.MailItem)
  Mail.Subject = "Hello"
  Mail.Save
  End Sub
  </code></pre>
  
  <p>It seems like I'm misunderstanding the MailItem.Save Method but I can't work it out.</p>
  
  <p>I'm using Outlook 2007.</p>
  
  <p>Any Ideas?</p>