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.
Similar threads
Thread starter Title 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 Recipients of Outlook messages have characters/words missing in body of message Using Outlook 6
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
T Custom Appointment Form Message Body Deleted upon reply. Outlook VBA and Custom Forms 3
witzker HowTo Change message Class of contact form Outlook VBA and Custom Forms 0
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
A Flag Message for Follow Up after sending Outlook VBA and Custom Forms 1
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
C Why won't Title display in message list? Using Outlook 1
icacream content in this message could not be downloaded.... Using Outlook 2
J Outlook 2016 After a search in all mailboxes, where is each message that was found? Using Outlook 6
R Warn before sending message Outlook VBA and Custom Forms 4
T Column to display which email alias a message was sent to Outlook VBA and Custom Forms 6
V Change start time based on message duration Outlook VBA and Custom Forms 2
J Message search and edit, another way? Outlook VBA and Custom Forms 4
N VBA to delete duplicates by message-id on common pst for 2 or more emails Outlook VBA and Custom Forms 0
S Create A Search Folder That Looks For Message Class? Outlook VBA and Custom Forms 0
T Missing text in e-mail message after "(Please keep confidential)" Using Outlook 3

Similar threads

Top