This macro for classic Outlook is probably the most useful for users who respond to messages sent by users using a different email clients or Windows / email language, where the Reply and Forward prefixes are different, such as AW: instead of RE:. It can also be used to remove or change other prefixes, such as External:.
To use, add it to ThisOutlookSession. It will run when you send the message.
Private Sub Application_ItemSend(ByVal item As Object, Cancel As Boolean)
Dim strSubject As String
Dim olPrefix As Variant
Dim olReplace As Variant
Dim i As Long
olPrefix = Array("RE:", "FW:", "External:")
olReplace = Array("Re:", "Fwd:", "")
strSubject = item.Subject
For i = 0 To UBound(olPrefix)
If InStr(1, strSubject, olPrefix(i)) > 0 Then
strSubject = Replace(strSubject, olPrefix(i), olReplace(i), vbTextCompare)
Exit For
End If
Next
item.Subject = Trim(strSubject)
item. Save
End Sub
How to use the macros on this page
First: You need to have macro security set to the lowest setting, Enable all macros during testing. The macros will not work with the top two options that disable all macros or unsigned macros. You could choose the option Notification for all macros, then accept it each time you restart Outlook, however, because it's somewhat hard to sneak macros into Outlook (unlike in Word and Excel), allowing all macros is safe, especially during the testing phase. You can sign the macro when it is finished and change the macro security to notify.
To check your macro security in Outlook 2010 and newer, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, look at Tools, Macro Security.
After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.
Macros that run when Outlook starts or automatically run need to be in ThisOutlookSession, all other macros should be put in a module, but most will also work if placed in ThisOutlookSession. (It's generally recommended to keep only the automatic macros in ThisOutlookSession and use modules for all other macros.) The instructions are below.
The macros on this page need to go into ThisOutlookSession.
Open the VBA Editor by pressing Alt+F11 on your keyboard.
To put the macro code in ThisOutlookSession:
- Expand Project1 and double click on ThisOutlookSession.
- Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)
More information as well as screenshots are at How to use the VBA Editor