* Fight inbox clutter. The total number of messages I sent today (instead of closing the loop with a visit, a phone call, or an IM) is indicated at the end of the subject line as (sent / quota).My quota, admittedly a constant in the code, is 10 messages/invites per day--and though there are days I exceed it, I think it's my average. I've also made this a public quest, explaining to people each time I follow up synchronously to an e-mail, that I'm stopping by because I think a conversation is a quicker way to resolve the issue than to respond with another e-mail.
We're using Outlook 2007, so I set up this VBA macro to remind me about my quotas. Tell me if you use it!
'About: D. André Dhondt, dhondtsayitsagile.blogspot.com
Dim WithEvents loadedMail As MailItem
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Cancel = canAvoidEmail()
End Sub
Private Function canAvoidEmail() As Boolean
Dim areYouSure As String
areYouSure = "You've already sent " & countSentMessages() & " messages today. " & _
"Are you sure a visit, a call, or an IM wouldn't resolve this? Click OK to send."
canAvoidEmail = (MsgBox(areYouSure, vbOKCancel) = vbCancel)
End Function
Private Function countSentMessages() As Integer
Dim sent As Outlook.MAPIFolder
Set sent = GetNamespace("MAPI"). GetDefaultFolder( olFolderSentMail)
countSentMessages = sent.Items.Restrict("[SentOn] > '" & Format(Date, "ddddd h:nn AMPM") & "'").Count
End Function
Private Sub Application_ItemLoad(ByVal Item As Object)
If TypeName(Item) = "MailItem" Then
Set loadedMail = Item
End If
End Sub
Private Sub loadedMail_Open(Cancel As Boolean)
If loadedMail.sent = False Then
loadedMail.Subject = loadedMail.Subject & " (" & 1 + countSentMessages & "/10)*"
End If
End Sub