|
|
| Next: Outlook Macro Developer |
| Author |
Message |
ker_01 External

Since: May 06, 2009 Posts: 3
|
Posted: Wed May 06, 2009 9:04 am Post subject: message body- find any words in my array? Archived from groups: microsoft>public>outlook>program_vba (more info?) |
|
|
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 to top |
|
 |
ker_01 External

Since: May 06, 2009 Posts: 3
|
Posted: Wed May 06, 2009 10:03 am Post subject: RE: message body- find any words in my array? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
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! |
|
| Back to top |
|
 |
Ken Slovak - [MVP - Outlo External

Since: Oct 17, 2003 Posts: 3355
|
Posted: Thu May 07, 2009 10:12 am Post subject: Re: message body- find any words in my array? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
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" <ker01 DeleteThis @discussions.microsoft.com> wrote in message
news:85DE61BF-CA2B-4A8B-8F03-CADE35FB64FC@microsoft.com...
> 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! |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|