On my work PC I have two outlook accounts, my account and a shared account.
All external emails that we receive have an annoying note added to the subject line which is basically a warning that it's an external email.
I used to have a script set up with a rule but for some reason the 'run a script' option is no longer available under rules. I'm guessing it was an update but I have no admin rights on the machine.
I've now found some VBA code online that I used to remove this unwanted note from all emails as they arrive.
But unfortunately this only works for my email address, not the shared account.
The code I am using is:
Option Explicit
Private WithEvents olInboxItems As Items
Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session
' instantiate objects declared WithEvents
Set olInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub
Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
On Error Resume Next
Item.subject = Replace(Item.subject, "CAUTION: External email - ", "")
Item.Save
Set Item = Nothing
End Sub
Any Ideas on how to make this work for both accounts?
All external emails that we receive have an annoying note added to the subject line which is basically a warning that it's an external email.
I used to have a script set up with a rule but for some reason the 'run a script' option is no longer available under rules. I'm guessing it was an update but I have no admin rights on the machine.
I've now found some VBA code online that I used to remove this unwanted note from all emails as they arrive.
But unfortunately this only works for my email address, not the shared account.
The code I am using is:
Option Explicit
Private WithEvents olInboxItems As Items
Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session
' instantiate objects declared WithEvents
Set olInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub
Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
On Error Resume Next
Item.subject = Replace(Item.subject, "CAUTION: External email - ", "")
Item.Save
Set Item = Nothing
End Sub
Any Ideas on how to make this work for both accounts?