+ Reply to Thread
Results 1 to 12 of 12

Read from table inside outlook email

  1. #1
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Read from table inside outlook email

    Hi all,

    I wanted to automate outlook emails to avoid wasting to much time in moving emails to a particular folder.
    To make sure I could automate it correctly I copy a table inside the email that I send out. When the email comes back, the automation will check the table, find a text in it (BIN nr) and then move it to the correct folder.

    The table looks like below:

    BIN nr: 1234567
    Company name: This Ltd.
    Status: New
    Rating: 1

    The table will have always be at the bottom of the email. It would be great if I could have it read at least the Rating first and the BIN nr. So the macro could find the correct folder.

    Any ideas how to read from a table?

    Greetings.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Read from table inside outlook email

    Do you have code to read the email?

    Also, is the email body plain text or HTML?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi Norie,

    So far I manage to find the below code:

    Please Login or Register  to view this content.
    The email should be in plain text but some one could also send in HTML I guess (could this be problematic?)

    Greetings.

  4. #4
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi,

    In the above code I can manage only to get the contents of the lines, but it needs to find a word instead and then look at the next word to the right, so it will use that word to find a folder.

    Greetings.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Read from table inside outlook email

    You can use InStr to find a substring within a string.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi Norie,

    No clue how to use the above code.
    I tried like this:
    Please Login or Register  to view this content.
    but the "pos" gives only 0

    Any idea how I could locate the word right to "Risk rating:"

    Greetings.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Read from table inside outlook email

    What I posted was an example of how you could use InStr to find where the table is.

    You'll need to adapt it, for example you'll need to take into consideration case sensitivity.
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi Norie,

    I found this code that can get the value to the left I look for, but if it could be adjusted to get the next word right to it, I could be lucky :-)

    Please Login or Register  to view this content.
    Greetings.

  9. #9
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi Norie,

    Some ideas?

    Greetings.

  10. #10
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi Norie,

    I managed to put this together:

    Please Login or Register  to view this content.
    It is working nice :-)

    All I need to do is to create the path where the email will be moved.

    Greetings.
    Last edited by Megatronixs; 02-12-2015 at 08:36 AM.

  11. #11
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi,

    How can I combine the below code with the above to create a path where the email will be copied?

    Please Login or Register  to view this content.
    It should take the "Rating" "BIN_nr" and "Company_Name" so it could construct a path like this: C:\my path\High\1234567_Company Ltd

    Greetings.

  12. #12
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Read from table inside outlook email

    Hi,

    I managed even the below. Now I only need it to not to copy the emails to the folder if there is no BIN nr in the email message.
    Where in the code can I put a spy to see if there is no BIN nr and if not, go to next email?

    Please Login or Register  to view this content.
    Greetings.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Email macro will not read from my table
    By Christopher Val in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-10-2015, 03:24 AM
  2. VBA : Paste Word.Table into Outlook email
    By Dt12345 in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 01-25-2015, 04:53 PM
  3. Pasting Table Autoformat into Outlook Email Body
    By frolicols in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2014, 11:30 AM
  4. Read/Export table from Outlook mail body to Excel using VBA
    By pradeepdeepu_001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2013, 06:48 AM
  5. Replies: 0
    Last Post: 07-07-2008, 12:03 PM

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