Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a reminder for replying specific emails
Sponsered Link
Hi ,

Recently I find that I may forget to reply some emails when I close my outlook. Some of them are very important to me and should be replied that day.

Outlook will remind me when some emails are not sended successfully when I close the outlook. I wonder if there is also a way that I can get a reminder to reply specific emails when I close outlook. Any ideas? It's about office2010

For that case, you may use a macro to do that. Try the codes below

Private Sub Application_Quit()
   Dim objInboxFolder As Outlook.Folder
   Dim objMail As Outlook.MailItem
   Dim i, n As Long
   Dim objPropertyAccessor As Outlook.propertyAccessor
   Dim strRepliedStatus As String
   Dim nDateDiff As Integer
   Dim strMailList As String
   Dim strMsg As String
   Dim nWarning As Integer

   Set objInboxFolder = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)

   n = 0
   For i = objInboxFolder.Items.Count To 1 Step -1
       Set objMail = objInboxFolder.Items.Item(i)

       If TypeOf objMail Is MailItem Then
          'Set the criteria for important emails as per your needs
          'Such as from specific sender or subject containing specific words
          If objMail.SenderEmailAddress = "" And InStr(LCase(objMail.Subject), "datanumen") > 0 Then

             'Check if the email is replied or not
             Set objPropertyAccessor = objMail.propertyAccessor
             strRepliedStatus = objPropertyAccessor.GetProperty("")
             If (Not (strRepliedStatus = 102)) And (Not (strRepliedStatus = 103)) Then

                'Only work for the recent incoming emails
                'Received within 12 hours
                nDateDiff = DateDiff("h", objMail.ReceivedTime, Now)
                If nDateDiff < 12 Then
                   n = n + 1
                   strMailList = strMailList & n & ". " & objMail.Subject & vbCrLf
                   strMsg = "You may forget to reply some important emails, as follows:" & vbCrLf & vbCrLf & strMailList & vbCrLf & "You had better restart your Outlook to reply them!"
                End If
             End If
         End If
      End If

   If strMailList <> "" Then
      nWarning = MsgBox(strMsg, vbExclamation + vbOKOnly, "Outlook Warning")
   End If
End Sub

You can find more details here

Good luck

Forum Jump:

Users browsing this thread: 1 Guest(s)