One of my supervisors likes to send out tons of emails with absolutely no subject… he uses Outlook, so today I had enough and wrote this little VBA gem:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If TypeName(Item) <> “MailItem” Then Exit Sub
If Len(Trim(Item.Subject)) = 0 Then
Dim splitItem As Variant
Dim s As String
s = Replace(Item.Body, vbCrLf, ““”)
splitItem = Split(s, ““”)
s = splitItem(0)
Item.Subject = s + “…”
Cancel = False
End If
End Sub
Just install it into your default VBA project (ALT-F11 in Outlook, expand the project tree on the left until you see “ThisOutlookSession”, double click that, paste and save!
Note: for some reason Split wouldn’t recognize a vbCr, so I had to replace the vbCrLf with another character.


