Skip to content

Instantly share code, notes, and snippets.

@stijnsanders
Created November 5, 2012 09:41
Show Gist options
  • Save stijnsanders/4016337 to your computer and use it in GitHub Desktop.
Save stijnsanders/4016337 to your computer and use it in GitHub Desktop.
Outlook script to replace empty subjects
Private Sub CheckEmptySubject()
Dim fi
Dim mi As Object
Dim s As String
Set fi = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
If fi.Items.Count <> 0 Then
Set mi = fi.Items.Item(fi.Items.Count)
If mi.Subject = "" Then
mi.Subject = "<E-mail without subject by " & mi.SenderName & " on " & CStr(Now) & ">"
'mi.ConversationTopic
mi.Save
End If
End If
End Sub
Private Sub Application_NewMail()
CheckEmptySubject
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment