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

message body- find any words in my array?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 6th 09, 05:04 PM posted to microsoft.public.outlook.program_vba
ker_01[_2_]
external usenet poster
 
Posts: 21
Default message body- find any words in my array?

Using Outlook 2003, and I'm not familiar with the Outlook model (I'm decent
in Excel VBA)

I have some working code that goes through an outlook folder and pulls some
key strings out of the message body, and appends them to a CSV text file that
I use in Excel. Right now it pulls that information (date, sender, invoice
number) for every email in the selected Outlook folder.

Now I'd like to limit the results to emails that do /not/ contain any of
about 12 words, as invoices with those products are not necessary for my
Excel number-crunching. What is the best (fastest) method to check the
message body and see if any word/string in my array is present, anywhere in
the email?

IgnoreArray = Array("adjusted", "deferred", "tax", "demurrage", "deposit",
[etc])

Thank you!
Ads
  #2  
Old May 6th 09, 06:03 PM posted to microsoft.public.outlook.program_vba
ker_01[_2_]
external usenet poster
 
Posts: 21
Default message body- find any words in my array?

As a temporary solution, I'm looping through each item in my array and
checking Inst(A,B)0. If there is a better way, please let me know and I'll
update my code accordingly.

Thanks!
Keith

"ker_01" wrote:

Using Outlook 2003, and I'm not familiar with the Outlook model (I'm decent
in Excel VBA)

I have some working code that goes through an outlook folder and pulls some
key strings out of the message body, and appends them to a CSV text file that
I use in Excel. Right now it pulls that information (date, sender, invoice
number) for every email in the selected Outlook folder.

Now I'd like to limit the results to emails that do /not/ contain any of
about 12 words, as invoices with those products are not necessary for my
Excel number-crunching. What is the best (fastest) method to check the
message body and see if any word/string in my array is present, anywhere in
the email?

IgnoreArray = Array("adjusted", "deferred", "tax", "demurrage", "deposit",
[etc])

Thank you!

  #3  
Old May 7th 09, 03:12 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default message body- find any words in my array?

That's about the best way I can think of, although I think you meant you're
using the InStr() function.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"ker_01" wrote in message
...
As a temporary solution, I'm looping through each item in my array and
checking Inst(A,B)0. If there is a better way, please let me know and
I'll
update my code accordingly.

Thanks!
Keith

"ker_01" wrote:

Using Outlook 2003, and I'm not familiar with the Outlook model (I'm
decent
in Excel VBA)

I have some working code that goes through an outlook folder and pulls
some
key strings out of the message body, and appends them to a CSV text file
that
I use in Excel. Right now it pulls that information (date, sender,
invoice
number) for every email in the selected Outlook folder.

Now I'd like to limit the results to emails that do /not/ contain any of
about 12 words, as invoices with those products are not necessary for my
Excel number-crunching. What is the best (fastest) method to check the
message body and see if any word/string in my array is present, anywhere
in
the email?

IgnoreArray = Array("adjusted", "deferred", "tax", "demurrage",
"deposit",
[etc])

Thank you!


 




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
Automatic response to emails based on words in subject or body Erin Outlook - Using Forms 3 October 28th 07 12:55 PM
Rule regarding words not in the body [email protected] Outlook - General Queries 1 August 14th 07 06:32 PM
filtering spam by words in body or buying rules? zero Outlook Express 3 September 1st 06 07:30 PM
OE6: Can email with certain words in body be blocked? Fred Outlook Express 2 June 14th 06 06:28 AM
Change advanced find to 'subject field and message body' ©® Outlook - General Queries 0 February 23rd 06 02:57 PM


All times are GMT +1. The time now is 11:50 PM.


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