Is there a way to block and give an alert if sending an email if the subject line has a series of equal to or greater than 5 digits?
![]()
Last edited by dreinisch; 09-12-2011 at 09:42 AM.
Paste the following into the ThisOutlookSession tab in the VBA editor (Alt f11).
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim MySubject As String Dim N As Long MySubject = Item.Subject For N = 1 To Len(MySubject) - 4 If IsNumeric(Mid(MySubject, N, 5)) = True And Len(Trim(Mid(MySubject, N, 5))) = 5 Then MsgBox "Subject contains at least 5 adjacent digits" Cancel = True End If Next N End Sub
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
Thank you! That worked like a charm!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks