Remove Subject Residual

Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
#1
Dear all,

I need some piece of advice. I am using the following code to strip message subjects of such words, as example {EXTERNAL}", "HA:", "[Ext]", "[EXTERNAL] and so on. Location is in ThisSession of Outlook.

I use the rule such as "with specific words in the subject"and "run a script".

I use Office 2013, Exchange Server. The account is set up on two computers, one PC is working station within active directory / domain. The 2nd computer is a laptop with the same accout, out of active directory / domain.

The rule and the script works fine, the only issue, from time to time it prompts an error and stop executing teh script. This happens both either on PC or laptop. Screenshots are attached.

Sub RemoveSubjectResidual(oItem As Outlook.MailItem)

On Error GoTo ErrHandler
Dim arr As Variant, i As Long
arr = Array("FW:", "Re:", "{EXTERNAL}", "HA:", "[Ext]", "[EXTERNAL]")
For i = 0 To UBound(arr)
oItem.Subject = Replace(oItem.Subject, arr(i), "", , , vbTextCompare)
Next

oItem.Subject = Trim(oItem.Subject)
oItem.Save

Exit Sub
ErrHandler:
MsgBox "Oops, an error has occured." & vbCrLf & vbCrLf & "Error Code : " & Err.Number & " , " & Err.Description
End Sub

Screenshot 01.png


Screenshot 02.png
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#2
This is with an Exchange account? I know imap accounts can load slow and trigger this error message on start up.

Is there any rhymn or reason to what triggers it - like only at startup, only if you received a lot of mail at once etc.
 
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
#3
Hello Diana,

Yes, this is Exchange account. Until now I could not identify what triggers it, in certain times the error message pops-up when Outlook was already running and there incoming emails when both PC Outlook and laptop Outlook are running at the same time.

Before I used to get this type of error more often, maybe every day or every other day (both PC Outlook and laptop Outlook are running at the same time) and I used to have different rule setting. It was "on this computer only" and the rule "with specific words in the subject" was unchecked.

What I intend to do now (until next week), I will use only PC Outlook and shutdown laptop Outlook until Thursday next week, maybe two sessions of Outlook cause conflict??? Although two sessions of Outlook should not, as I launch up to three sessions of Outlook on PC with no conflict.
 
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
#4
Dear all,

Looks like there is another reason, it tripped today again, attached is screenshot. Only PC was running, laptop was off. I cannot understand what tripped it, although there was an incoming reading confirmation and I have opened reminder window with pending tasks. Could either of these be a cause for trigger of the above mentioned?

Sreenshot.png
 
Top