PDA

View Full Version : Outlook macro: to select numbers from e-mail message



libor.tesar
05-21-2011, 11:33 AM
Hello all,
I am quite new writing VBA codes for Outlook. I have done this for Excel, Word, Corel etc. I would like to ask a question or advice. Does exist a technique or possibility to search in MS Outlook e-mail messages (plain or html) specified mail folder for a any given 8 or 9 digit number separated by space? Usually there are two digits in one e mail message and there are hundreds of mail messages in mail folders. The macro should go through each message in descending order according to date, select both numbers, copy them either to ecxel or access and continue until the end (last) of specified mail message.
I can imagine to create this in excel but have you any idea for outlook? Going through the mail messages, setting the criteria for numbers and taking them out to another application.

Thanks a lot for any advice
Libor
:banghead:

Charlize
05-25-2011, 06:23 AM
Are those emails in a certain format (layout style) ?

ex. account:id123
due:5019.17
pastdue:1000.05

You can acces outlook from within excel, get all the messages (and/or necessary info) and do sorting and alike in excel.

Charlize

libor.tesar
05-25-2011, 02:34 PM
Hi Charlize,
the format is usualy html and the layout is
xxxxxxxx xxxxxxxx
as it was typed in a word and copied to outlook or directly wrote in the outlook. However, it is good idea to access outlook within the ecxell.
Hope it would work if there are plenty of unsorted e mails in the directory. I will try anyway.
Thanks a lot.
Libor

Benzadeus
06-02-2011, 01:01 PM
The pattern you want to search is on the mail's body, right?
Which information do you want to extract, e.g., to Excel? Subject? Sender address? etc.

it is good idea to access outlook within the excell
I don't know how you guys usually do, but I never use Outlook to create another Applications. I always make another Applications open Outlook, unless I'm having serious login problems.