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!
 
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!
 
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
G Get current open draft message body from VBA Outlook VBA and Custom Forms 1
C Populate form data into message body Outlook VBA and Custom Forms 1
J Outlook 365 Add keywords from Listbox to the message body where cursor is placed Outlook VBA and Custom Forms 0
J Implement Keywords based on body message Outlook VBA and Custom Forms 0
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
M When I click “new message” in outlook, my cursor defaults to the body of the m Using Outlook 6
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
B Please remind me how I added this message button Outlook VBA and Custom Forms 0
E PgUp and PgDn don't work for displayed message content (but do for web pages) Using Outlook 4
M A plug in (or method) to keep email message formatting after it expires Using Outlook 1
Rob Can't save MailItem because the message changed in .pst file Outlook VBA and Custom Forms 0
M Search message, then (1) Jump to folder & (2) Select message that you searched for Outlook VBA and Custom Forms 7
Kika Melo How to mark as Junk any message not from Contacts (in Outlook.com) Using Outlook 3
G Outlook 365 My iCloud Outlook doesn’t work after reinstalling Microsoft365 on Windows 10 PC – now I get error message on contacts and calendar Using Outlook 1
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
F Outlook 2019 Forwarding Message and Keeping Unread Status Outlook VBA and Custom Forms 0
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1

Similar threads

Back
Top