Scanning E-mail for Certain words & changing the background

Status
Not open for further replies.
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,

rhutch
 
S

Sue Mosher [MVP]

In what version of Outlook? Highlight those words in an open message? In the

reading pane?

Sue Mosher

"Rhutch" wrote:


> 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,
> > rhutch
 
R

Rhutch

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,

rhutch

"Sue Mosher [MVP]" wrote:


> In what version of Outlook? Highlight those words in an open message? In the
> reading pane?
> > Sue Mosher
> > >

> "Rhutch" wrote:
>
> > 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,
> > > > rhutch
 
R

Rhutch

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.

thanks,

rhutch

"Rhutch" wrote:


> 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,
> > rhutch

> "Sue Mosher [MVP]" wrote:
>
> > In what version of Outlook? Highlight those words in an open message? In the
> > reading pane?
> > > > Sue Mosher
> > > > > > > > "Rhutch" wrote:
> >
> > > 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,
> > > > > > rhutch
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Gmail mail is being delivered to a different email inbox in Outlook App 2021 Using Outlook 2
P What is your strategy for dealing with SPAM and Junk Mail? Using Outlook 1
C Code to move mail with certain attachment name? Does Not work Outlook VBA and Custom Forms 3
T 1:1 Datatransfer from incoming mail body to customs form body Outlook VBA and Custom Forms 0
O Mail rule issue Using Outlook 3
A manual rule sends mail to wrong folder Using Outlook 5
Aussie Outlook 365 Rule runs manually but returns the error code "an unexpected error has occurred" when incoming mail arrives Using Outlook 1
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
witzker Outlook 2019 Macro to answer a mail with attachments Outlook VBA and Custom Forms 2
D Outlook 2003 Mail Fails Using Outlook 1
Cathy Rhone Mail merge error message Using Outlook 2
R Sent emails show iCloud mail account not the alias Using Outlook 2
D Advanced e-Mail search on from/to contact group only searches for first 20 contacts in group Using Outlook 0
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
P Importing other e-mail accounts into Outlook Using Outlook 1
lcarpay Stay in the mail folder pane after ctrl-1 Using Outlook 1
O Exchange Sync period only (e.g. last years mail) Using Outlook 0
F Excel VBA to move mails for outlook 365 on secondary mail account Outlook VBA and Custom Forms 1
M Convertor for Outlook Express Mail Store (.dbx) to Outlook Mail Store (.pst) Using Outlook 0
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
J E-mail held in Outbox while Minimized Using Outlook 3
G Forward email body to other mail list directly from Exchange server Exchange Server Administration 1
T Outlook creates a copie of every mail I send Using Outlook.com accounts in Outlook 4
N Please advise code received new mail Using Outlook 0
M Outlook 2010 How could I globally redesign an outlook template form/region/inspector template used to display mail lists or an individual mails? Outlook VBA and Custom Forms 0
A How to stop user form from disapearing once mail window is closed? Outlook VBA and Custom Forms 0
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
R How to Sync *all* Google Workspace Mail Folders with Outlook 2019 (MS365) Using Outlook 3
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
S Outlook email to configure setup for each mail Outlook VBA and Custom Forms 1
L Correct E-Mail Pulling Wrong Mail Using Outlook 5
S Outlook mail adressing stops after first match in GAL Using Outlook 0
P Outlook 2013 All imported Mail Rules in error when imported into new profile Using Outlook 5
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
MrMayor SENT mail not reloading to top?? Using Outlook 4
Terry Sullivan Sender Field Displays My E-Mail Address, Not My Name Using Outlook 1
ThinkToday Calculate reply time of outlook mail Using Outlook 1
B Outlook 2010 Opening Mail Attachment Using Outlook 2
e_a_g_l_e_p_i Is it possible it set the fonts used to read incoming mail Using Outlook 25
D Mail in Sent Items Gone Using Outlook 12
M Managing Gmail "All Mail" sync issues with IMAP Using Outlook 1
GregS Outlook 2016 Sent Mail absent from Sent Mail or Sent Items Folders Using Outlook 4
GregS Why is Outlook 2016 mail in Outlook.com? Using Outlook 1
S Outlook not receiving mail Using Outlook 1
Commodore Outlook (2013) issues with icloud.com mail Using Outlook 0
GregS Outlook 2016 iPhone won't download Outlook 2016 Mail. Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
oliv- How to distinguish whether mail is incoming or outgoing? Outlook VBA and Custom Forms 2

Similar threads

Top