Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Office > Outlook

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-11-2019, 10:31 AM
Sacwb3 Sacwb3 is offline Mac OS X Office 2016
Novice
 
Join Date: Jan 2019
Posts: 1
Sacwb3 is on a distinguished road
Default Outlook - How do I sort Subject line by a date within the subject line

Office 365 - Outlook



We have a project management system that sends us an email when a task has been completed. in the subject line there is the construction site number and a specific milestone date after the site number.

We wish to sort by the date within the subject line even though the date is not appearing at the beginning of the subject line.

Example subject line;

Site OH0550004B Alert: Rev 1 Redline Construction Drawings - Milestone 6 Completion Forecast: 2019/04/15


Notice that the milestone date of completion is at the end of the subject line. This is what we want to be able to sort by.

Is there a rule that I can use for this?


We have not been successful getting the project management software to move the date to the front of the subject line. We have tried.

Any assistance is greatly appreciated.
Reply With Quote
  #2  
Old 01-11-2019, 10:00 PM
gmayor's Avatar
gmayor gmayor is online now Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,670
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

The following script (MoveDate) if run from a rule will add the date from the end of the subject to the start of the subject. Test it with a selected message and the test macro.



Code:
Option Explicit

Sub Test()
Dim olMsg As MailItem
    On Error Resume Next
    Set olMsg = ActiveExplorer.Selection.Item(1)
    MoveDate olMsg
lbl_Exit:
    Exit Sub
End Sub

Sub MoveDate(oItem As MailItem)
Dim sText As String
    If oItem.Subject Like "Site * Alert:*" Then
        sText = Right(oItem.Subject, 10)
        If IsDate(sText) = True Then
            oItem.Subject = sText & Chr(32) & oItem.Subject
            oItem.Save
        End If
    End If
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't see full text of From and Subject line in Outlook 2013 poptranslation Outlook 0 12-15-2016 04:34 AM
Change subject to include date and time in subject officechris Outlook 1 05-01-2015 09:58 PM
Auto Subject Line hollwall Outlook 0 04-19-2012 08:49 AM
Outlook - Add text to subject line when sending a reply email rparker85 Outlook 3 12-12-2011 10:26 AM
Outlook 2010 Web Access Subject line length Emerogork Outlook 4 06-08-2011 05:50 PM


All times are GMT -7. The time now is 10:08 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft