Receive a Reminder When a Message Doesn't Arrive?

Status
Not open for further replies.

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Diane Poremsky submitted a new article on Slipstick.com

Receive a Reminder When a Message Doesn't Arrive?

I’m often asked how to be reminded if a message does not arrive within a specified time. This a popular request by administrators and others who receive routine status messages. When a status message doesn't arrive, it can mean there is a problem.

Is it possible to set a reminder, or email myself automatically, if a particular email does not arrive by a certain time every hour?​


Yes, you can do this using a run a script rule. Outlook doesn't have a timer, so you'll need to...
Continue reading the Original Article at Slipstick.com
 

Logesh

New Member
Outlook version
Outlook 2010 64 bit
Email Account
POP3
Hi Diane, U are doing an awesome job. Thanks much for doing such an excellent work.
This code is working fine at home, yet in my office system I’m encountering latency. When I researched the reason for latency I could sense the following syntax is causing the delay in execution. ( If LCase(objVariant.Subject) = LCase(Item.Subject) And objVariant.SentOn < Item.SentOn Then). As information, I’m using outlook 2010 I changed macro security settings to enable all macros and restarted the outlook multiple times but no luck yet. Not sure why in my office system the outlook is getting freeze to 12 seconds when the macro executes. Would it be due to some other reason? Is there way to fix this? Any help is really appreciated.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
What type of email account are you using at work? If Exchange, is it cached locally?
 

Logesh

New Member
Outlook version
Outlook 2010 64 bit
Email Account
POP3
Yes its exchange. Cache is not enabled but if i enable, the macro is working fine without latency, however for a reason i'm not suppose to enable the cache. Is there a workaround to make the macro work without enabling the cache?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I kind of figured it was that since it seems to hang on this line:
If LCase(objVariant.Subject) = LCase(Item.Subject) And objVariant.SentOn < Item.SentOn Then

That is comparing the subject and sent date of the new message with all previous messages looking for a match. Because it's doing it "over the wire", it's slower. (A large mailbox will be slower too.)

I'm not sure this will work, but try adding an eexit sub after end with - this will exit after the first match. As long as it's working newest to oldest (or the old messages are deleted), it should work. But I'm not sure it does that. I'll see if we can add a filter and speed it up.

End With

'or just delete the older messages
' objVariant.Delete

Exit Sub
Else
End If
End If
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
The macro checks each message in the inbox for a match - with class online mode, it had to go out to the server, which results in the slower response time. As long as you only have one match (or Outlook finds the newest one first) you could exit when it finds the match.

With objVariant
.ClearTaskFlag
.Categories = ""
.Save
End With

'or just delete the older messages
' objVariant.Delete

Exit Sub
Else
End If

A filter instead of a loop could also improve the response time - something like this:
sFilter = "[Subject] = " & LCase(objVariant.Subject)
Set ResItems = MailItems.Restrict(sFilter)
'Loop through the items in the collection.
For Each Item In ResItems
If objVariant.SentOn < Item.SentOn Then
' do whatever
Next
 

Logesh

New Member
Outlook version
Outlook 2010 64 bit
Email Account
POP3
Hi Diane, Thanks much for your response. I tested in my personal outlook (in which the account type is not exchange) and it works fine. I didn't get chance to text in exchange account. I will be testing it in 1 or 2 days. I'll keep you posted on the result. Thanks again.
 

Logesh

New Member
Outlook version
Outlook 2010 64 bit
Email Account
POP3
One more question. It's understandable that if the macro matches the subject then it clears the reminder and un-flags the original email. If the reply email contains RE: (default prefix in subject) then macro is not considering that as a match and as a result it's not clearing the reminder or un-flags the original email, but actually it should clear. I would feel happy if you suggest a syntax that will not consider RE: or FW: default prefix in subject.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
We can check for : in the 3rd position and trim it before searching. I'll take a look.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Something like this will work -

Code:
strSubject = LCase(objVariant.Subject)

if instr(strSubject, ":") =3 then

strSubject = right(strSubject, len(strSubject)-4)

end if

sFilter = "[Subject] = " & strsubject
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I must be losing my mind, because I swear I answered this last night. :) Or maybe it was a similar question from another users... anyway, you'll use an If statement - something like this -

sSubject = LCase(objVariant.Subject)


if InStr(sSubject , ":") = 3 then
sSubject = right(sSubject, len(ssubject) - 4)
end if

sFilter = "[Subject] = " & ssubject
 
Status
Not open for further replies.
Top