A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to (Use Outlook to search for text in message)



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 25th 07, 01:41 PM posted to microsoft.public.outlook.program_vba
sturger
external usenet poster
 
Posts: 1
Default How to (Use Outlook to search for text in message)

I would like to know how to create a macro that will read all messages in
current and sub folders looking for the following information,

Messages where "Leave Alone" is found and out put is
Virus Found "Inserts Virus iNFO" | Computer "Computer Name"

Example Alert message
Alert: Virus Found TEST
Leave Alone
Computer: PC1234
Date: 11/24/2007
Time: 7:09:59 PM
Severity: Critical


Thanks,

Ads
  #2  
Old November 26th 07, 06:00 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How to (Use Outlook to search for text in message)


Here's a sample for how to loop recursively through the folders:
http://www.vboffice.net/sample.html?...owitem&lang=en

For the current folder first call:

LoopItems Application.activeExplorer.CurrentFolder

And then:

LoopFolders Application.ActiveExplorer.CurrentFolder.Folders

In HandleItem you might look for any text either in the item's Subject or
Body property. Use the Instr function for that.

--
Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6


Am Sun, 25 Nov 2007 05:41:00 -0800 schrieb sturger:

I would like to know how to create a macro that will read all messages in
current and sub folders looking for the following information,

Messages where "Leave Alone" is found and out put is
Virus Found "Inserts Virus iNFO" | Computer "Computer Name"

Example Alert message
Alert: Virus Found TEST
Leave Alone
Computer: PC1234
Date: 11/24/2007
Time: 7:09:59 PM
Severity: Critical


Thanks,

  #3  
Old November 26th 07, 07:02 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How to (Use Outlook to search for text in message)

Another approach would be to use the Application.AdvancedSearch method, which can both search subfolders and do substring searches.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Michael Bauer [MVP - Outlook]" wrote in message ...

Here's a sample for how to loop recursively through the folders:
http://www.vboffice.net/sample.html?...owitem&lang=en

For the current folder first call:

LoopItems Application.activeExplorer.CurrentFolder

And then:

LoopFolders Application.ActiveExplorer.CurrentFolder.Folders

In HandleItem you might look for any text either in the item's Subject or
Body property. Use the Instr function for that.

--
Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6


Am Sun, 25 Nov 2007 05:41:00 -0800 schrieb sturger:

I would like to know how to create a macro that will read all messages in
current and sub folders looking for the following information,

Messages where "Leave Alone" is found and out put is
Virus Found "Inserts Virus iNFO" | Computer "Computer Name"

Example Alert message
Alert: Virus Found TEST
Leave Alone
Computer: PC1234
Date: 11/24/2007
Time: 7:09:59 PM
Severity: Critical


Thanks,

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Live Search Maps for Outlook - How to stop text pasting in meeting Victoria@DIG Outlook - Calandaring 4 October 30th 08 11:04 PM
Search & Replace Text in the Body of a Message dch3 Outlook and VBA 1 June 7th 07 03:45 AM
search for text in a message, OE 6 roger Outlook Express 1 February 27th 07 12:43 AM
Instant Search Outlook 2007 Text Display Incorrect HNiesewand Outlook - Installation 0 June 4th 06 01:58 PM
Search email for text string to use in filename - save email text bsteiner Outlook and VBA 3 June 1st 06 10:20 PM


All times are GMT +1. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.