message body- find any words in my array?

  • Thread starter Thread starter ker_01
  • Start date Start date
K

ker_01

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!
 
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
 
That's about the best way I can think of, although I think you meant you're
using the InStr() function.




ker_01 said:
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 said:
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!
 
Back
Top