+ Reply to Thread
Results 1 to 2 of 2

Loop new messages containing a table, populate a dynamic array, paste array to Excel

  1. #1
    Registered User
    Join Date
    05-19-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Loop new messages containing a table, populate a dynamic array, paste array to Excel

    Hi everyone,

    I have tried to solve the following puzzle for awhile and am looking for some insights.

    The situation is as follows. I receive several emails per day to a specified email account. The mail box does not receive any other messages than the ones I am interested but in theory it could. Each and every email contain a data table with a header, where the number of rows and columns alter from one email to another. The message body contains just a table. In each and every email, the column headers are named systematically/uniquely and I am only interested in three of them (there could be more than three depending on the email). Let's call them USER, TASK, and NUMBER. The number of rows (observations) vary between emails but not within emails; i.e. the three columns I am interested always have the same number of rows per unique email.

    In order to make things complicated, I would prefer the application to run silently on the background without prompting the user every now and then. Also, I am not sure if this is feasible, the macro would run always when one opens Outlook for the first time as well as when new message arrives (if this makes the application really heavy, one can always use a timer that will run the code let's say every 15 minutes).

    Steps:
    1. Look Unread mailitems containing a table
    2. Loop through all those messages in the mailbox and populate an array
    3. Open a new excel file, call the array from the VBA memory, save the file, and close it
    4. Open a new mailitem, enter a recipient, add attachment, and send
    5. Run again when a new email arrives or after a specified time interval

    First of all, is this even possible?

    Below you can see the code showing where I need help.

    Thank you for taking your time to read through the message.

    Any help is welcome and much appreciated!

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    05-19-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Loop new messages containing a table, populate a dynamic array, paste array to Excel

    I am especially interested to know how to continue populating the same data array? Any ideas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1