Update subject based on text in body

Status
Not open for further replies.

kasper

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
I would love to be able to automate a time consuming, tedious process that a couple of us are faced with in the office.
We receive around 130 emails 6x a year with no way to easily identify the school the email is about. There is a string within the body that looks like this - S987654.X# (the X being either a C or U and the # could be anything between 1-5). If anyone could be so kind to help me get something together that would check the incoming email body for the string and compare it to an array I would put together of all our schools and append the subject line with the school name (to come before the existing subject line). The emails would always come from 1 of 2 email addresses so it would only have to look at those addresses specifically.
Although I love tinkering with excel formulas and know some php coding, I am at a complete loss when it comes to VBA, but am excited to see something automated instead of doing the same job manually.
 
If anyone can point me in the right direction to put something together to automate this tedious process I'd really appreciate it.
 
sorry about that - i meant to put something together (because its an interesting idea) and am swamped. I have this macro - Outlook AutoReplies: One Script, Many Responses - which shows how to set up the array, but rather than send a reply, you would add the subject to the incoming messages and save it.

You can use this function to search the body for the code: Use RegEx to extract text from an Outlook email message


strText = Item.Body
strCode = ExtractText(strText)
For i = LBound(arrQuestion) To UBound(arrQuestion)
' look for the code here - using regex might be the best method
If InStr(strCode, arrQuestion(i)) Then
item.subject = arrAnswer(i) & item.subject
item.save
' since you'll only have one match, you can quit when its found
exit sub
Next i

remove the if/end in the Do something section to the end sub
 
actually, this If InStr(strCode, arrQuestion(i)) Then should be
If strCode = arrQuestion(i) Then
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B Update Item.Subject property Using Outlook 1
J Outlook 2010 - missing "Updated: ... " in subject text after calendar update Using Outlook 2
A trap outbound mail to update subject Outlook VBA and Custom Forms 6
P Can no longer sync Outlook with iPhone calendar after iPhone update to 17.1.1 Using Outlook 7
M "Attachment Detacher for Outlook" add in, does it update the server copy of the email? Using Outlook 1
icacream New password won't update Using Outlook 2
Commodore Safe way to add or update holidays; Windows Notifications issue Using Outlook 8
O Batch update calendar Using Outlook 3
R Outlook 365 update sets delete from server flag Using Outlook 1
V Update new custom field Outlook VBA and Custom Forms 5
P Outlook 2019 UI changes after 20H2 update Using Outlook 1
D Change Microsoft Account password - what to do to update on all devices Using Outlook 4
K can't get custom form to update multiple contacts using VBA Outlook VBA and Custom Forms 3
B Outlook 2016 Retail C2R keeps logging since update? Using Outlook 0
C Not sync folders not found after MS Outlook 365 update Using Outlook 1
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
D.Moore VBA script fail after Office 365 update Using Outlook 8
W April 2020 Office 365 Update - Add-Ons fail after Office 365 Update Using Outlook 6
M Outlook 2010 Problem with OutLook 2010 32 bit, after Windows Auto Update Using Outlook 3
Jennifer Murphy Grant R/W (update) access to a friend Using Outlook 3
L Favorites don't update Using Outlook 1
F Copy and replace not update contact in another pst Using Outlook 0
M Message list font changed after update Using Outlook 2
M Quicken One Step Update Bill Reminders Not Syncing to Outlook Using Outlook 1
O Windows 1803 update : QAT and toolbar changed, language pack gone... Using Outlook 5
J Updating existing entry on shared calendar wants to send update from delegate Using Outlook 0
N Using email notification to update calendar events? Outlook VBA and Custom Forms 4
K Update Appointment category when changed in Excel Using Outlook 3
V Outlook 2003 problem with Windows 10 Creators Update 1709 Using Outlook 0
G Windows Update Causes BCM Database Access Problem? BCM (Business Contact Manager) 4
A Creating Progress Bar or Status Bar Update Outlook VBA and Custom Forms 0
M Recent Update Did not Fix Search Problems Using Outlook 7
R Custom Contact Form how to update when loaded. Outlook VBA and Custom Forms 6
C Update Notes for Meeting Attendees Using Outlook 8
A Attendee Update Outlook Meeting Invite Using Outlook 0
Diane Poremsky Outlook Email Security Update Using Outlook 0
S Task Update coming as email and not updating task Using Outlook 3
Diane Poremsky Remove Office 2013 Update Banner Using Outlook 0
B IMAP folders don't update when Outlook 365 opens Using Outlook 0
J Outlook Macro to Update Sharepoint Excel File Using Outlook 1
Diane Poremsky Task Request Status Update Address Missing Using Outlook 0
CWM550 Importing from Eudora Update Using Outlook 5
Cameron Piper Automatically update custom forms across multiple computers Outlook VBA and Custom Forms 1
M Update field codes when opening Outlook Template Outlook VBA and Custom Forms 2
Bachelle Macro to Update Existing Task from New Email Outlook VBA and Custom Forms 3
I Microsoft Security Update KB3097877 Using Outlook 14
S Outlook 2010: October 2015 Update Using Outlook 0
S Outlook 2013: October 2015 Update Using Outlook 0
Diane Poremsky Update Contacts with a New Company Name and Email Address Using Outlook 0
Diane Poremsky Update Contacts with a New Company Name and Email Address Using Outlook 0

Similar threads

Back
Top