message body- find any words in my array?

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!
 
K

ker_01

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
 
K

Ken Slovak - [MVP - Outlook]

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top