Scanning E-mail for Certain words & changing the background

  • Thread starter Thread starter Rhutch
  • Start date Start date
R

Rhutch

Hello,
I have been asked to write a macro for Outlook that will scan an e-mail for
select words such as Voluntary, Surrender, etc. and then change the
background (highlight) those words found in an e-mail. I have used VBA in
Excel and Access but not in Outlook.

I looked through all 43 pages on the site and could not find a post to help.
Probably looked right past several.

Anyway, any help would be appreciated.

thanks,
 
In what version of Outlook? Highlight those words in an open message? In the
reading pane?
 
Sue:

I tried several times to log into the Community newsgroup but couldn't seem
to get the web page to display after attempting to log-on. I finally get it
to respond. I have read your response and hopefully can provide the
information you requested. I am using version 2003 of Outlook at work. The
intent, I think, is to open an e-mail and run a macro that looks for certain
words. Once it finds an occurrence of one of the words, it highlights it,
and changes the background to a different color, such as yellow, then
continues to the end of the e-mail. The person who asked me to do this for
him apparently gets several e-mails a day, 30 or so pages long and currently
has to go through them manually to find the designated words.

Hope you get this.
Thanks very much for responding,
 
I was able to get some code that scans a Word document highlights a word the
user enters but it won't work on Outlook.

Sub FindRepetitiveWords()
'
' Find Repetitive Words Macro
' Macro recorded 11/6/2003 by Monica Burns

'//Get Info from User

'//Place information in variable sUserString and Insert into document

Dim sUserString As String

sUserString = InputBox("Please Enter The Word to Search For", "Word
Searching For")

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True

With Selection.Find
.Text = sUserString
.Replacement.Text = sUserString
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With

Selection.Find.Execute Replace:=wdReplaceAll

End Sub

If anybody can point me to something that would show how to conver t it
Outlook, I would appreciated it.
 
Back
Top