Implement Keywords based on body message

Juliano

New Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
I'm looking for a way to implement keywords inside the body message.
The algorithm will read the body message and add the keywords inside the same body message.
Read > Extract the keywords by using the RemoveStopWords Function > Write the keywords inside the message body.

Keywords: Sales, Invoice, etc.

I have one file containing some StopWords as mentioned, a function called RemoveStopWords.
Steps of my algorithm
1-Triggered by a custom button
2-Read the body message and store it in some variable
3-Read the file that has the StopWords ("C:\Users\Juliano\Documents\ListOfStopWords.txt")
4-Store the stopwords (step 3) in some variant variable
5-Remove the stopwords from the body message that are stored in some variable (step 2)
6-Store the Keywords in some variable (KeyWord as variant)
7- Update the variable that stored the body message (step 2) including the Keywords (step 6)

Code:
Public Function RemoveStopWords( _
       ByVal Phrase As String, _
       ByVal WordToRemove As String _
       ) As String


    Dim RetVal As String
    Dim Tmp As String


    'remove the word in the middle of the phrase
    RetVal = Replace(Phrase, " " & WordToRemove & " ", " ")


    'remove the word at the beginning
    Tmp = WordToRemove & " "
    If Left(RetVal, Len(Tmp)) = Tmp Then
        RetVal = Mid(RetVal, Len(Tmp) + 1)
    End If
    'remove the word at the end
    Tmp = " " & WordToRemove
    If Right(RetVal, Len(Tmp)) = Tmp Then
        RetVal = Left(RetVal, Len(RetVal) - Len(Tmp))
    End If
    RemoveStopWords = RetVal
End Function
 
Similar threads
Thread starter Title Forum Replies Date
R How to implement customize toolbar in outlook? Outlook VBA and Custom Forms 1
I vba scrip to move emails based on long keywords list Outlook VBA and Custom Forms 0
I outlook rule keywords based on list Using Outlook 0
A Message Rules based on Keywords in the Message Body Using Outlook.com accounts in Outlook 1
O Script to move emails to a folder based on various possible keywords Outlook VBA and Custom Forms 11
A Macro to file emails into subfolder based on subject line Outlook VBA and Custom Forms 1
T Outlook Template - textbox visible based on combobox selection Using Outlook 1
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
R Auto Assign Category colours to Incoming Emails based on whom the email is addressed Outlook VBA and Custom Forms 3
geoffnoakes Outlook 2016 Searching based on CreationTime Using Outlook 3
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
V Change start time based on message duration Outlook VBA and Custom Forms 2
A Move email items based on a list of email addresses Outlook VBA and Custom Forms 40
Andrew Quirl Custom form to route requests based on input criteria Outlook VBA and Custom Forms 1
K Conditional Formatting based on Department of person received from? Outlook VBA and Custom Forms 4
L Office 365 cloud based rules Using Outlook 1
mctabish Setting "Reply To" based on inbox Outlook VBA and Custom Forms 2
H Select Specific Account When Sending Email, Based on Current Folder Outlook VBA and Custom Forms 1
icacream Rule based on sender / wrong sender sent to folder Using Outlook 7
D Moving Emails Based on Recipient/Sender Outlook VBA and Custom Forms 4
K Update subject based on text in body Outlook VBA and Custom Forms 3
A Sort emails into subfolders based on sender and deleting emails automatically Outlook VBA and Custom Forms 3
N automatic response with an attachment based on the subject line Outlook VBA and Custom Forms 1
M Move new mail to folder based on sender address Outlook VBA and Custom Forms 2
D Help with code to move mail on receipt to another folder based on time received Outlook VBA and Custom Forms 2
G Addition of 2 fields based on checkboc true or false Outlook VBA and Custom Forms 2
A Add attachments to appointment based on field values Outlook VBA and Custom Forms 0
A Automatically send email based on drop-down field? Outlook VBA and Custom Forms 2
ashcosta2 Auto Reply rule based on speficied time Outlook VBA and Custom Forms 0
K Append subjectline based on number Using Outlook 4
N Outlook script to forward emails based on senders' address Outlook VBA and Custom Forms 2
C Auto Add a PDF to an outgoing Email, based on a rule Using Outlook 2
D How to Run a Report Based on Age of Inbox Items Outlook VBA and Custom Forms 0
J Autoforward emails to different contacts based on certain criteria using only one rule Using Outlook 1
J Group email messages based upon information in InfoBar Using Outlook 0
D Delete previous email based on arrival of new email Outlook VBA and Custom Forms 1
S Send email from excel based on a condition (outlook 2007) Outlook VBA and Custom Forms 1
bifjamod Saving sent email to specific folder based on category with wildcard Outlook VBA and Custom Forms 1
Tech Checkers Make Outlook add Contact Card Address in Location Field based on Appointment Subject Name. Using Outlook 2
V Outlook 2010 – Send email based on categories Using Outlook 2
K Outlook 2010 - Set the category based on category of other emails in same conversatio Using Outlook 20
G VBA code to enable a rule based on time of day for a IMAP mail account Outlook VBA and Custom Forms 14
H Rule to move emails based on subject and content Outlook VBA and Custom Forms 1
S Updating the database based on received task Outlook VBA and Custom Forms 3
L changing view settings based on message body Using Outlook 1
S Filtering based on mailing list field Using Outlook 1
B Need Help Creating Email Based on Subject w Address in Body Outlook VBA and Custom Forms 1
N VBA, Rule that will Auto Reply based on time of day Outlook VBA and Custom Forms 1
M How do I mark emails already received as read when I get a second, different email based on subject? Outlook VBA and Custom Forms 3
Randy Redekopp Filtering a view based on a custom field Using Outlook 1

Similar threads

Top