I got many emails every day. Can I use VBA to search every mail in my
inbox, and highlight the keywords (I have a list of keywords)? Further,
if a keyword exit in a mail, flag the mail so I will be able to read
these mails first?
For this purpose, if you have other approaches, please advise.
Thanks in advance.
Hong
>I got many emails every day. Can I use VBA to search every mail in my
> inbox, and highlight the keywords (I have a list of keywords)? Further,
[quoted text clipped - 6 lines]
>
> Hong
Yes, if you are adept in VBA and are reading your emails as richtext or html
(or I guess you could highlight plain text with * characters)
Alternatively, use, Tools, Organize, using colors, Automatic formatting.
Wouldn't highlight key phrases within the body, but would be a lot simpler.

Signature
John Blessing
http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters
wisemax@yahoo.com - 29 Dec 2005 14:04 GMT
It was quick!!!!! Thank you John.
I never write VBA code for Outlook, although I write a lot of codes for
Excel. Can you share some codes to get me started? I will modify them
myself.
Hong
John Blessing - 29 Dec 2005 17:39 GMT
> It was quick!!!!! Thank you John.
>
[quoted text clipped - 3 lines]
>
> Hong
Not tested but should give you the general idea:
Private Sub Application_NewMail()
Dim objOl As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objMailitem As Outlook.MailItem
Dim objFolder As MAPIFolder
dim lPos as long
Dim lIndex As Long
Set objOl = New Outlook.Application
Set objNameSpace = objOl.GetNamespace("MAPI")
objNameSpace.Logon
Dim strOrderBody As String
On Error Resume Next
Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
lIndex = 1
Do While lIndex <= objFolder.Items.Count
Set objMailitem = objFolder.Items(lIndex)
If Err.Number = 0 Then
If objMailitem.UnRead Then
lpos = instr(1, objmailitem.body ,"yourphrase")
do while lpos <> 0 and lpos < len(objmailitem.body)
if lpos > 0 then
objmailitem.body = left (objmailitem.body
,lpos-1) & "****" & _
mid ( objmailitem.body , lpos )
end if
lpos = instr(lpos + len("yourphrase"), objmailitem.body
,"yourphrase")
loop
objmailitem.save
end if
end if
lIndex = lIndex +1
loop
end sub

Signature
John Blessing
http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters
wisemax@yahoo.com - 29 Dec 2005 14:21 GMT
It was quick!!!!! Thank you John.
I never write VBA code for Outlook, although I write a lot of codes for
Excel. Can you share some codes to get me started? I will modify them
myself.
Hong
Diane Poremsky [MVP] - 29 Dec 2005 15:23 GMT
Visit outlookcode.com - while vba is vba, because outlook uses so many
different windows and doesn't have a macro recorder for you to learn from,
it's not as simple as writing vba for excel (or word).

Signature
Diane Poremsky [MVP - Outlook]
Author, Teach Yourself Outlook 2003 in 24 Hours
Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide)
Need Help with Common Tasks? http://www.outlook-tips.net/beginner/
Outlook Tips: http://www.outlook-tips.net/
Outlook & Exchange Solutions Center: http://www.slipstick.com
Subscribe to Exchange Messaging Outlook newsletter:
EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM
> It was quick!!!!! Thank you John.
>
[quoted text clipped - 3 lines]
>
> Hong