message body- find any words in my array?

Status
Not open for further replies.
A

a2VyXzAx

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

a2VyXzAx

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!
 
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" <ker01> 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!
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
M VBA to auto forward message with new subject and body text Outlook VBA and Custom Forms 8
S Custom Form, copy user field data to message body Outlook VBA and Custom Forms 12
M Want to autorespond to an email address in the body of message Using Outlook 0
H Search and delete part of a link inside HTML body message Outlook VBA and Custom Forms 2
J Increase font size of message body Using Outlook 5
Mark Foley Emailing attachment from Word/Excel sends attachment but no message body Using Outlook 0
A Create Macro for hyperlink(email) in message body Outlook VBA and Custom Forms 9
T What code to use to move the custom field values to message body when sending e-mail ? Outlook VBA and Custom Forms 8
L changing view settings based on message body Using Outlook 1
moks applying a rule to the message body only Using Outlook 1
J Creating a URL from a message body excerpt before forwarding Using Outlook 2
E Automatically pick up Recipient's Name on the Body of the Email Message Using Outlook 1
A Message Rules based on Keywords in the Message Body Using Outlook.com accounts in Outlook 1
H Using Outlook Rules to search for NewLines in message body Using Outlook 1
Tim King Message body problems Using Outlook 3
I jump to body in open message with one keyboard shortcut? Using Outlook 3
M Extract text in existing message body for use in newmail items Using Outlook 17
D Message body missing but attachments present Using Outlook 0
I Outlook Appointments - Setting default text in message body Using Outlook 3
G Calculated Date Field In Message Body Using Outlook 1
T Html tags in Message body Using Outlook 1
E MIME encoding appearing in body of message Using Outlook 3
L Inserting a PPT/PDF into the message body Using Outlook 1
B Received Plain Text Message - Body Grayed Out Using Outlook 1
W Conditional Formatting - Message Body only works to about 200 characters Using Outlook 2
C Bug? Forwarded message body is blank Using Outlook 2
C Outlook 2007 No text in Message body Using Outlook 1
Z I cannot type on Outlook's message body.__ Using Outlook 3
E Attach Item within Body of a Message in Outlook 2007 Using Outlook 1
B OUTLOOK NO LONGER SHOWS MESSAGE BODY....... Using Outlook 2
M eMail failure with certain URLs in body of message Using Outlook 1
B incoming POP mail displays HTML tags in message body, how to turn tag dumping off? Using Outlook 2
M Outlook 2010 Illustrations ribbon is greyed out. Composing HTML and cursor is in message body. Using Outlook 1
R How to make attachments display as icons on the header and not in the body of the message - when sen Using Outlook 1
F Outlook 2010 will not pull in my email from my provider &amp; the font in the body of the message area is so small it can't be read unless I use a #72 Using Outlook 5
O huge fonts in the message body Using Outlook 3
N Outlook - Word doc attachment in body message showing really tiny Using Outlook 2
J In Outlook e-mail double spacing between paragraphs in the body of the message Using Outlook 2
W Recipients of Outlook messages have characters/words missing in body of message Using Outlook 6
K I am not able to type in the body of an email that I create or that I reply to. I can't even activate the cursor in the message body area. Using Outlook 1
K Auto complete a line/phrase in the body of a message. Using Outlook 2
D Blank message body when sending or receiving HTML formated emails Exchange 2010 Exchange Server Administration 15
D Using VBA to send Word document as body of message works in 2007, but not in 2003 Outlook VBA and Custom Forms 9
M How to input text at the beginning of the body of a message. Outlook VBA and Custom Forms 1
P How to get Selected Body message Text Outlook VBA and Custom Forms 7
S get current position in message body of mailitem Outlook VBA and Custom Forms 8
A Keep format of message in the body Outlook VBA and Custom Forms 1
C Controls in message body Outlook VBA and Custom Forms 1
M Reply with picture in body of message Outlook VBA and Custom Forms 2
R Reply with custom form & selected data from message body Outlook VBA and Custom Forms 3
Similar threads


















































Top