VBA to send reminder email if no response

Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
#1
Halo Team,

I am looking for a VBA to send follow up/reminder email if there is no response received within 1 day. The action should happen on emails where subject line states "Attention".

I found few VBA codes however I am getting an error. "Compile error: Only valid in object module"

Below is the part of the code where am getting error.

Private WithEvents olSentItems As Items

Thank you in advance for your help.
 
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
#3
Thanks for your reply. I tried running the code from the Outlook session as suggested, still I don't see the result.

Is there any other code. Because I have 50 - 80 reminder emails to send on weekly basis.

Your help on this would be very much appreciated.

Thank you in advance for your support as always.
 
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
#5
I got the code from below blog/fourm:

How to Get a Notification If Not Receiving the Reply of a Specific Email within Expected Time - Data Recovery Blog


Public WithEvents objInboxItems As Outlook.Items

Private Sub Application_Startup()
Set objInboxItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
End Sub

'If receive the reply, clear the flag and remove the reminder
Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
Dim objSentItems As Outlook.Items
Dim objVariant As Variant
Dim i As Long
Dim strSubject As String
Dim dSendTime As String

Set objSentItems = Outlook.Application.Session.GetDefaultFolder(olFolderSentMail).Items

If Item.Class = olMail Then
For i = 1 To objSentItems.Count
If objSentItems.Item(i).Class = olMail Then
Set objVariant = objSentItems.Item(i)
strSubject = LCase(objVariant.Subject)
dSendTime = objVariant.SentOn

If LCase(Item.Subject) = "re: " & strSubject Or InStr(LCase(Item.Subject), strSubject) > 0 Then
If Item.SentOn > dSendTime Then
With objVariant
.ClearTaskFlag
.ReminderSet = False
.Save
End With
End If
End If
End If
Next i
End If
End Sub

'Get a prompt asking if to send a notification email
Private Sub Application_Reminder(ByVal Item As Object)
Dim strPrompt As String
Dim nResponse As Integer
Dim objFollowUpMail As Outlook.MailItem

'You can change the subject as per your real case
If (Item.Class = olMail) And (LCase(Item.Subject) = "datanumen outlook repair") Then
strPrompt = "You haven't yet recieved the reply of " & Chr(34) & Item.Subject & Chr(34) & " within your expected time. Do you want to send a follow-up notification email?"
nResponse = MsgBox(strPrompt, vbYesNo + vbQuestion, "Confirm to Send a Follow-Up Notification Email")
If nResponse = vbYes Then
Set objFollowUpMail = Application.CreateItem(olMailItem)
With objFollowUpMail
.To = Item.Recipients.Item(1).Address
.Subject = "Follow Up: " & Chr(34) & Item.Subject & Chr(34)
.Body = "Please respond to my email " & Chr(34) & Item.Subject & Chr(34) & "as soon as possible"
.attachments.Add Item
.Display
End With
End If
End If
End Sub
 
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
#6
Hi,

Did you get a chance to look into the above scenario, if yes any update on the same.
 

Bamerand

New Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
#7
I would be interested in reading the response from Diana, this is topic I was long time interested in...
 
Top