Forum Discussion
MatsNorway_ECOSTOR
Sep 19, 2022Copper Contributor
How to remove [External:] from subjects coming in - Office 365
A rule was added on admin level, it breaks the conversation threads and creates a huge mess for anyone with a lot of email coming in. If anyone got any tips on that front, that would be great!
MatsNorway_ECOSTOR
Sep 19, 2022Copper Contributor
Having throuble activating running scripts. Edit: made it work by running it "on this computer" only then the script shows up as an alternative.
https://www.extendoffice.com/documents/outlook/4640-outlook-rule-run-a-script-missing.html
MatsNorway_ECOSTOR
Sep 19, 2022Copper Contributor
The code i am trying to run as a script:
Const CLASS_NAME = "SendAndReceive"
Private WithEvents olkApp As Outlook.Application
Private bolSend As Boolean, bolReceive As Boolean
Private Sub Class_Initialize()
bolSend = True
bolReceive = True
Set olkApp = Outlook.Application
End Sub
Private Sub Class_Terminate()
Set olkApp = Nothing
End Sub
Private Sub olkApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
If (Left(Item.Subject, 4) = "FW: ") Or (Left(Item.Subject, 4) = "RE:") Then
Item.Subject = Mid(Item.Subject, 5)
Item.Save
Else
If Left(Item.Subject, 5) = "Fwd: " Then
Item.Subject = Mid(Item.Subject, 6)
Item.Save
End If
End If
End Sub
Private Sub olkApp_NewMailEx(ByVal EntryIDCollection As String)
Dim arrEID As Variant, varEID As Variant, olkItm As Object
arrEID = Split(EntryIDCollection, ",")
For Each varEID In arrEID
Set olkItm = Outlook.Session.GetItemFromID(varEID)
If olkItm.Class = olMail Then
Select Case Left(olkItm.Subject, 4)
Case "FW: ", "RE: ", "SV: "
olkItm.Subject = Mid(olkItm.Subject, 5)
olkItm.Save
End Select
End If
Next
Set olkItm = Nothing
End Sub
Public Sub ToggleSend()
bolSend = Not bolSend
MsgBox "The process of removing RE: and FW: on sent messages has been turned " & IIf(bolSend, "'On'", "'Off'"), vbInformation + vbOKOnly, CLASS_NAME
End Sub
Public Sub ToggleReceive()
bolReceive = Not bolReceive
MsgBox "The process of removing 'RE:', 'FW:', and 'Fwd:' on received messages has been turned " & IIf(bolReceive, "'On'", "'Off'"), vbInformation + vbOKOnly, CLASS_NAME
End Sub
Const CLASS_NAME = "SendAndReceive"
Private WithEvents olkApp As Outlook.Application
Private bolSend As Boolean, bolReceive As Boolean
Private Sub Class_Initialize()
bolSend = True
bolReceive = True
Set olkApp = Outlook.Application
End Sub
Private Sub Class_Terminate()
Set olkApp = Nothing
End Sub
Private Sub olkApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
If (Left(Item.Subject, 4) = "FW: ") Or (Left(Item.Subject, 4) = "RE:") Then
Item.Subject = Mid(Item.Subject, 5)
Item.Save
Else
If Left(Item.Subject, 5) = "Fwd: " Then
Item.Subject = Mid(Item.Subject, 6)
Item.Save
End If
End If
End Sub
Private Sub olkApp_NewMailEx(ByVal EntryIDCollection As String)
Dim arrEID As Variant, varEID As Variant, olkItm As Object
arrEID = Split(EntryIDCollection, ",")
For Each varEID In arrEID
Set olkItm = Outlook.Session.GetItemFromID(varEID)
If olkItm.Class = olMail Then
Select Case Left(olkItm.Subject, 4)
Case "FW: ", "RE: ", "SV: "
olkItm.Subject = Mid(olkItm.Subject, 5)
olkItm.Save
End Select
End If
Next
Set olkItm = Nothing
End Sub
Public Sub ToggleSend()
bolSend = Not bolSend
MsgBox "The process of removing RE: and FW: on sent messages has been turned " & IIf(bolSend, "'On'", "'Off'"), vbInformation + vbOKOnly, CLASS_NAME
End Sub
Public Sub ToggleReceive()
bolReceive = Not bolReceive
MsgBox "The process of removing 'RE:', 'FW:', and 'Fwd:' on received messages has been turned " & IIf(bolReceive, "'On'", "'Off'"), vbInformation + vbOKOnly, CLASS_NAME
End Sub
- Victor_IvanidzeSep 19, 2022Bronze ContributorEven if you manage VBA code to work, what about other users? Or you are not interested in company-wide solution?
- MatsNorway_ECOSTORSep 19, 2022Copper ContributorI doubt me alone will convince that revert, but they might as more has asked the question. For now i will try to wash the subject field on incoming and hopefully not break the conversation thead. Currently without me doing anything it breaks up it seems.
- Victor_IvanidzeSep 19, 2022Bronze ContributorOK, do as you wish. If you've decided to fight against the corporate policy - good luck!